null in a string
okay, my problem is that i have a string that contains a null character and amx thinks its the end of the line.
how could i split the text to get rest of the data? here's an example script: Code:
Code:
Lenght: 3, String: abc |
You can't do what you are doing...if you explain why you need a "NULL" (doesn't exist in PAWN) character we can tell you the right way to do it.
|
im trying to query gameservers using sockets, and the responses contain null characters (at least i think so, coz i only get the server type and ip)
|
well the problem is that using client_print() it will only go into a string untill it reaches its end ("NULL" , '\0') those don't exist exactly in PAWN but using the way you do or '^0' work in PAWN.
So the string will contain it but it wont print with client_print() |
What the hell are you talking about? NULL exists in PAWN! It has a different token, but its the same damn character; PAWN uses ASCII just like other languages try to.
A null character defines the END of the string. You cannot read past it; past the end of the string is invalidated data. There is no way to do this without running through each and every cell of the string and replacing the null characters with other characters. |
mm, well this works:
Code:
it stores all info to the file correctly till playersnum, after that its just screwed :? Code:
/dlhow to make any sense of them? (btw theyre all byte values) |
I was saying there is no if(str[1] == NULL) when saying there is no NULL. I know its there as a termination character.
|
Suicid3, your post says:
Quote:
|
I meant an actual NULL.
|
come on :?
Code:
/dlso the first two characters must be playersnum and maxplayers, but how to convert them into readable numbers? |
| All times are GMT -4. The time now is 20:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.