Bad letters like " !?="#" and space etc..
#1

So I have this code

pawn Код:
ValidateWord(const string[]) {
    for( ; ; ) {
        switch(string[0]) {
            case 'a'..'z', '0'..'9', 'A'..'Z': {
                #emit load.s.pri string
                #emit add.c 4
                #emit stor.s.pri string
            }
            case EOS: {
                return true;
            }
            default: {
                break;
            }
        }
    }
    return false;
}
DialogResponse..
pawn Код:
else if (ValidateWord(inputtext)) // bad characters
                {
                    // Test text here..
                }
And it's not working.. How come ?
It doesn't send that SendClientMessage with "test" even if I insert any of those letters "#!#%?&$(/& etc
Reply
#2

This function do sth different, you should do it like this:

PHP код:
stock ValideWord(const word[])
{
    new 
i;
    for( ; ; 
i++)
    {
        switch(
word[i]) {
            case 
'a'..'z''0'..'9''A'..'Z': continue;
            case 
EOS: return 1;
            default: break; 
        }
    }
    return 
0;

Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)