12.06.2010, 19:57
I've got this function,
and
Console shows
Is it because of stupidness of PAWN?
pawn Код:
implode(glue, ...) //ported from PHP
{
new RetString[256],
GetString[64],
GlueString[2],
index;
GlueString[0] = glue;
for(new i = 1, c = numargs(); i < c; i++)
{
for(;;)
{
GetString[index] = getarg(i, index);
if(GetString[index] == 0)
break;
index++;
}
strcat(RetString, GetString);
strcat(RetString, GlueString);
GetString[0] = '\0';
index = 0;
}
printf("%s", RetString); //just little debug
return RetString;
}
pawn Код:
print(implode(',', "123", "742", "638", "532", "167"));
Quote:
[21:49:10] 123,742,638,532,167, <- showed by debug (in end of function) [21:49:10] 167, <- returned |