26.09.2011, 05:38
pawn Код:
stock CheckDate(datestr[])
{
new pos, slashes, numbers[3], atpos;
while(datestr[pos] != 0)
{
if(datestr[pos] == ' ') continue;
if(datestr[pos] == '/')
{
slashes ++;
atpos ++;
continue;
}
if(strval(datestr[pos]) < 0 || strval(datestr[pos]) > 9) return 0;
else
{
numbers[atpos] ++;
}
}
if(atpos > 2) return 0;
if(numbers[0] != 2 || numbers[1] != 2 || numbers[2] != 4) return 0;
return 1;
}