How to check
#6

pawn Код:
if(!IsNumeric(inputtext) || strlen(inputtext) < 0 || strlen(inputtext) > 4 || strval(inputtext) < 1960 || strval(inputtext) > 2010) return printf("No inputtext 4 char and numeric and no value 1960 - 2010");
    else printf("perfect %d", strval(inputtext));
Simplifield:
pawn Код:
if(!IsNumeric(inputtext) || strval(inputtext) < 1960 || strval(inputtext) > 2010) return print("inputtext no value 1960 - 2010");
    else printf("perfect %d", strval(inputtext));
pawn Код:
stock IsNumeric(string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
    {
        if (string[i] > '9' || string[i] < '0') return false;
    }
    return true;
}
Final:
pawn Код:
if(strval(inputtext) < 1960 || strval(inputtext) > 2010) return print("inputtext no value 1960 - 2010");
    else printf("perfect %d", strval(inputtext));
Reply


Messages In This Thread
How to check - by Torran - 06.03.2010, 17:31
Re: How to check - by Torran - 06.03.2010, 17:52
Re: How to check - by ¤Adas¤ - 06.03.2010, 17:53
Re: How to check - by Torran - 06.03.2010, 17:58
Re: How to check - by ¤Adas¤ - 06.03.2010, 18:05
Re: How to check - by smeti - 06.03.2010, 20:22

Forum Jump:


Users browsing this thread: 1 Guest(s)