11.06.2017, 05:52
isnull(string) is same as strlen(string) == 0 ?
No:
1) Checking if a string is empty by using "strlen" is terrible, because if the string isn't empty it will take much longer. 2) Not all "null" strings are actually length zero. There is a bug in the PAWN VM which means you can't pass fully empty strings (actually, I don't think there is, but I thought there was when I wrote "CallRemoteFunction"). So instead of just "\0", it passes "\1\0" for empty strings. So if you use ZCMD and type a command with no parameters, "params" will have length 1, but "isnull" knows about this and will return true. |