16.04.2008, 03:32
I was wondering if there is a more efficient way to check the value of a variable: i (i is used in a for loop).
I am currently doing this:
This gives me the following errors:
Line 263 is the for() line.
I know you can simply check with a continue statement, but I wondered if there was a 'safer' way.
The .pdf said that the variable must be non-constant, so that it can be modified, so I wasn't sure how that variable was not constant.
I did try asking on IRC, but it appeared that everybody was busy, idling, or perhaps just ignoring me
Thanks in advance,
I am currently doing this:
pawn Code:
for(new i = 0; i <= MAX_PLAYERS; (i != playerid) ? i++ : i += 2)
{
print("Simon is a nubzorz."); // Not actually doing this, but w/e.
}
Code:
C:\PROGRA~1\ROCKST~1\GTASAN~1\Samp\GAMEMO~1\para.pwn(263) : error 022: must be lvalue (non-constant) C:\PROGRA~1\ROCKST~1\GTASAN~1\Samp\GAMEMO~1\para.pwn(263) : warning 215: expression has no effect C:\PROGRA~1\ROCKST~1\GTASAN~1\Samp\GAMEMO~1\para.pwn(263) : error 001: expected token: ";", but found ")" C:\PROGRA~1\ROCKST~1\GTASAN~1\Samp\GAMEMO~1\para.pwn(263) : error 029: invalid expression, assumed zero C:\PROGRA~1\ROCKST~1\GTASAN~1\Samp\GAMEMO~1\para.pwn(263) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
I know you can simply check with a continue statement, but I wondered if there was a 'safer' way.
The .pdf said that the variable must be non-constant, so that it can be modified, so I wasn't sure how that variable was not constant.
I did try asking on IRC, but it appeared that everybody was busy, idling, or perhaps just ignoring me
Thanks in advance,
~Cueball~