Small question
#4

There's a much simplier/faster way.

pawn Код:
stock IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return 0;
    }
    return 1;
}
Example of usage:
pawn Код:
if (IsNumeric(inputtext))
{
    // inputtext contains only numbers, do something here..
}
Reply


Messages In This Thread
Small question - by Devoted - 22.12.2013, 20:34
Re: Small question - by CutX - 22.12.2013, 20:45
Re: Small question - by Devoted - 22.12.2013, 20:46
Re: Small question - by Konstantinos - 22.12.2013, 20:51

Forum Jump:


Users browsing this thread: 4 Guest(s)