SA-MP Forums Archive
[Include] [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) (/showthread.php?tid=85697)

Pages: 1 2 3


Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - ball - 16.05.2018

Код:
printf("%s %s %s", dest[0], dest[1], dest[2]);



Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - Yousha - 16.05.2018

Quote:
Originally Posted by ball
Посмотреть сообщение
Код:
printf("%s %s %s", dest[0], dest[1], dest[2]);
IK that, but PHP's version of same code works fine:

PHP код:
$source "123,456,789";
$dest explode(","$source);
printf("%s %s %s"$dest[0][1], $dest[0][2], $dest[1][2]); 
Result:

Quote:

2 3 6

So I think there's a bug...


Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - Kar - 16.05.2018

Quote:
Originally Posted by Yousha
Посмотреть сообщение
IK that, but PHP's version of same code works fine:

PHP код:
$source "123,456,789";
$dest explode(","$source);
printf("%s %s %s"$dest[0][1], $dest[0][2], $dest[1][2]); 
Result:



So I think there's a bug...
Does PAWN spell 'PHP'?


Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - Yousha - 17.05.2018

Quote:
Originally Posted by Kar
Посмотреть сообщение
Does PAWN spell 'PHP'?
Get out, spammer.

Quote:
Westie: Missed PHP's excellent string modification functions? Yeah, but that was because it was easy.




Re: [INC] strlib v1.3 - Simple string modification (Update: 21/10/09) - Yousha - 19.05.2018

Quote:

[22:17:28] [debug] Run time error 10: "Native function failed"
[22:17:28] [debug] strins
[22:17:28] [debug] AMX backtrace:
[22:17:28] [debug] #0 00000930 in str_ireplace (sSearch[]=@0031fbb0 ",Test", sReplace[]=@002864f0 "", sSubject[]=@00101d0c "Test,Test,Test,Test,Test,", &iCount=@00316ad8 2) at J:\Desktop\PAWN\SA-MP\X\pawno\include\strlib.inc:124

strlib.inc version: 1.3.0

Код:
#define _strlib_med_string 256

new sTemp[128], sReturn[_strlib_med_string];
// ...
strins(sReturn, sReplace, iIndex, iLengthReplace); // Line #124