Actions
Bug #399
closedGosub and Goto using variable fails (integer or string)
Start date:
06/27/2020
Due date:
% Done:
0%
Estimated time:
2:00 h
Affected version:
Description
Gosub using variable fails. (related to bug #28)
The result is a syntax error.
#manifest: "pc"
#splashScreen: false
#speed: "safe"
#fps: false
X=20
Gosub X
End
20 Print "line 20"
Return
This also fails when using labels:
#manifest: "pc"
#splashScreen: false
#speed: "safe"
#fps: false
X=20
X$="MyLabel"
Gosub X$
End
MyLabel:
Print "My Label"
Return
NOTE: In both cases, you can work around this bug by putting the expression within parentheses, but this should NOT be required. Any valid expression should be allowed.
NOTE2: This was also a bug in AMOOS Pro (for numerics). String expressions weren't a problem in AMOS Pro (but they are in AOZ!).
Here's the syntax description from the manual... as it should be:
GOSUB
structure: jump to a sub-routine
Gosub label
Gosub number
Gosub expression
NOTE that there are NO parentheses in the syntax!
NOTE also that string labels are NOT case-sensitive!
Actions