02.08.2012, 16:11
Hi, I've been trying to use for loops in cases like so:
switch(listitem)
{
for (new hatswitch=0; hatswitch < db_num_rows(Result); hatswitch++)
{
case hatswitch:
So that it makes a response for every resulting row in the query.
But that gives me the following errors:
F:\*** ******* *******\***\******.pwn(14127) : error 002: only a single statement (or expression) can follow each "case"
F:\*** ******* *******\***\******.pwn(14127) : error 029: invalid expression, assumed zero
F:\*** ******* *******\***\******.pwn(14127) : warning 215: expression has no effect
F:\*** ******* *******\***\******.pwn(14127) : warning 215: expression has no effect
F:\*** ******* *******\***\******.pwn(14127) : error 029: invalid expression, assumed zero
F:\*** ******* *******\***\******.pwn(14127) : fatal error 107: too many error messages on one line
Any help?
Line 14127 is "for (new hatswitch=0; hatswitch < db_num_rows(Result); hatswitch++)"
switch(listitem)
{
for (new hatswitch=0; hatswitch < db_num_rows(Result); hatswitch++)
{
case hatswitch:
So that it makes a response for every resulting row in the query.
But that gives me the following errors:
F:\*** ******* *******\***\******.pwn(14127) : error 002: only a single statement (or expression) can follow each "case"
F:\*** ******* *******\***\******.pwn(14127) : error 029: invalid expression, assumed zero
F:\*** ******* *******\***\******.pwn(14127) : warning 215: expression has no effect
F:\*** ******* *******\***\******.pwn(14127) : warning 215: expression has no effect
F:\*** ******* *******\***\******.pwn(14127) : error 029: invalid expression, assumed zero
F:\*** ******* *******\***\******.pwn(14127) : fatal error 107: too many error messages on one line
Any help?
Line 14127 is "for (new hatswitch=0; hatswitch < db_num_rows(Result); hatswitch++)"