The compiler should flag the illegal use of GOTO and GOSUB statements, as it would for the illegal use of any other statement.
No matter what one thinks of the GOTO and GOSUB statements, they are a valid part of the language. It seems very strange to me that the compiler tests the correct usage of other statements, but leaves it to the programmer to get it right for these two statements.
For example, the compiler does not flag this as an error:
Code: Select all
x.l = 0
Select x
Case 1
Goto IllegalJump
Case 2
EndSelect
IllegalJump:
What is incorrect use, and under what conditions could incorrect use cause a program to crash?This command is used to transfer the program directly to the labels position. Be cautious when using this function, as incorrect use could cause a program to crash.
The help entry might just as well be:
We have provided the GOTO and GOSUB statements, but we're not documenting all the rules for their use, and the compiler will not test that you are using them correctly. Good luck and have a nice day.
