23.06.2010, 18:23
You could use the function IsNumeric or just make your own version. Here's the IsNumeric function.
That's an older version. There may be a newer version out there. I'm not sure if this would return false if there was a string like "f2fs984hg2". If it did say that wasn't numeric then you could just use a loop to search the string for any number.
pawn Код:
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0')
{
return 0;
}
}
return 1;
}