thebetter1
05-31-2008, 01:42 PM
For some reason, the compiler doesn't like that I have left braces after my while loops. It tells me to put a semicolon after them instead, but then it interprets while as a function. Why won't it accept my left braces? It also does the same thing with the if loops.
import "std.zh"
ffc script Homing_on_X {
void run(ffc HomingFFC) {
While(true) {
If(Link->X < HomingFFC->X) {
HomingFFC->Vx = -5;
}
If(Link->X > HomingFFC->X) {
HomingFFC->Vx = 5;
}
If(Link->X == HomingFFC->X) {
HomingFFC->Vx = 0;
}
Waitframe();
}
}
}
Edit: I finally figured out that while can't be capitalized.:banghead:
import "std.zh"
ffc script Homing_on_X {
void run(ffc HomingFFC) {
While(true) {
If(Link->X < HomingFFC->X) {
HomingFFC->Vx = -5;
}
If(Link->X > HomingFFC->X) {
HomingFFC->Vx = 5;
}
If(Link->X == HomingFFC->X) {
HomingFFC->Vx = 0;
}
Waitframe();
}
}
}
Edit: I finally figured out that while can't be capitalized.:banghead: