ShadowMancer
06-05-2007, 12:43 AM
from what i understand zscript is basically the C language with built in functions, so why does it not seem to understand a switch statement?
example of code i wrote:
switch (best_dir)
{
case 1:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->y-=4
Waitframe();
}
break;
case 2:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->x-=4
Waitframe();
}
break;
case 3:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->y+=4
Waitframe();
}
break;
case 4:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->x+=4
Waitframe();
}
break;
}
Am i useing this wrong or is it not possible to use switch
(or is it select..case, i always get confused when useing different languages :rolleyes: )
example of code i wrote:
switch (best_dir)
{
case 1:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->y-=4
Waitframe();
}
break;
case 2:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->x-=4
Waitframe();
}
break;
case 3:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->y+=4
Waitframe();
}
break;
case 4:
for (int n = 1 ; n<16 ; n+=4)
{
this_ffc->x+=4
Waitframe();
}
break;
}
Am i useing this wrong or is it not possible to use switch
(or is it select..case, i always get confused when useing different languages :rolleyes: )