query string length should be...? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: query string length should be...? (
/showthread.php?tid=654361)
query string length should be...? -
AndreiWow - 27.05.2018
Query string length should be the count of characters used in the query as it is in the script, or the count of characters which will be once those values are replaced by actual values?
For example
%s - 2 characters, but that could be replaced with 'Unknown' which is 7 characters
Re: query string length should be...? -
AmigaBlizzard - 27.05.2018
Replace each holder (%s, %d, %i, %f, whatever) by the maximum values it can hold.
For an integer, it's -2000000000 (almost, but it's the length of the text that counts, not the value itself), so for an int, it's 11 characters.
For a string, it can be longer than that.
If it's only used to hold a player's name, provide space for 24 characters.
If you're saving messages for the chat, use 144 characters.
If you save a plate for a vehicle, it's only 7 characters.
I do it by copying the text into Notepad, then replace each holder by their max values and then put the cursor at the last character to see the length of the string.
Re: query string length should be...? -
AndreiWow - 27.05.2018
Thanks