SA-MP Forums Archive
tolower from Y_LESS is buggy? - 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: tolower from Y_LESS is buggy? (/showthread.php?tid=359913)



tolower from Y_LESS is buggy? - Bubelbub - 15.07.2012

Source: http://forum.sa-mp.com/showpost.php?...17&postcount=7
pawn Code:
#define tolower(%0) \
    (((%0) >= 'A' && (%0) <= 'Z') ? ((%0) | 0x20) : (%0))
I use this.
pawn Code:
new option[30];
format(option, sizeof option, "TeSt");"
format(option, sizeof option, tolower(option));
And i get this Error.
Code:
error 033: array must be indexed (variable "option")
(in "tolower" string)


Re: tolower from Y_LESS is buggy? - Roko_foko - 15.07.2012

It changes(tolowers) only one char, not whole string.

if you want whole string
pawn Code:
for(new i=0;option[i];i++)
option[i]=tolower(option[i]);



AW: tolower from Y_LESS is buggy? - Bubelbub - 15.07.2012

Year, i see.
Iґm tired -.-
I should go sleep, xD

pawn Code:
for(new x = 0; x < strlen(option); x++)
    option[x] = tolower(option[x]);
omg -.-

can closed ...

But thank you!