26.08.2015, 09:15
Quote:
Код:
functionB38(arg0, &arg1) { new var0 = strlen(arg0); while(arg1 < var0 && arg0[arg1] <= 32) { arg1++; } new var1 = arg1; new var2[20]; while(arg1 < var0 && arg0[arg1] > 32 && arg1 - var1 < 19) { var2[arg1 - var1] = arg0[arg1]; arg1++; } var2[arg1 - var1] = 0; return var2; } |
pawn Код:
functionB38(cmdtext, var1);
pawn Код:
functionB38(arg0[], &arg1)
{
// ...
The way I see it, is that it just returns part of string, starting at index of arg1 and ending in space (32) sign, and also assigns the value of variable sent via reference to number of characters returned by this command (length, string not it's size)
pawn Код:
new a = 0;
functionB38("abc def", a); // Must be 'a' because of reference. Isn't it pointless?
// returns: abc and 3 (assigned to a)
Greetings