Switch..case statement???
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:
Code:
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: )
Re: Switch..case statement???
Because I haven't implemented it yet.
Switch is very nasty to implement in a compiler, as it's complex both in terms of syntax and semantics, and so didn't make ZScript's first cut. Which is not to say I won't get around to it in the future.