Why is this litle code resulting in a parse error?:
Error:"GlobalScript.asc(72): Error (line 72): PE04: parse error at 'else' [Line72 is the "else if" line]
Code:
function repeatedly_execute() {
mouse.UseModeGraphic (eModePointer);
if (Label11.Text == "Random order, infinite loop"){
if (IsTimerExpired(1)) player.ChangeRoom(Random(4) + 1); // (highest room number-1) + (1)
if (IsGamePaused() == 1) return;
if (IsKeyPressed(eKeyEscape)){
mouse.Visible = true;
QuitGame(1) ;
mouse.Visible = false;
else if (Label11.Text == "Chronological order, no loop"){
}
}
}
}
else if (Label11.Text == "Chronological order, no loop"){ //You forgot a dot. Label11Text is what you had.
Darn. Thanx Dual but I still got the same error after adding the forgotten dot....
There's a missing } before the else if.
Indent your code:
function repeatedly_execute() {
mouse.UseModeGraphic (eModePointer);
if (Label11.Text == "Random order, infinite loop") {
if (IsTimerExpired(1)) player.ChangeRoom(Random(4) + 1); // (highest room number-1) + (1)
if (IsGamePaused()) return;
if (IsKeyPressed(eKeyEscape)) {
mouse.Visible = true;
QuitGame(1) ;
mouse.Visible = false;
} // <<--- ### WAS MISSING
else if (Label11.Text == "Chronological order, no loop") {
}
}
}
Thanx Khris, that seemed to be the final problem.