Project

General

Profile

Bug #399

Gosub and Goto using variable fails (integer or string)

Added by Brian Flanagan over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
High
Target version:
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!

#1

Updated by Brian Flanagan over 3 years ago

  • Affected version changed from 0.9.9.2 to 0.9.9.3

Corrected affected version.

#2

Updated by Laurant Weill over 3 years ago

  • Priority changed from Normal to High
#3

Updated by Brian Flanagan over 3 years ago

  • Estimated time set to 2:00 h
  • Affected version changed from 0.9.9.3 to Beta RC2

Re-tested in Beta RC2. Both examples still fail.

#4

Updated by Francois Lionet over 3 years ago

  • Status changed from New to Resolved
  • Assignee set to Francois Lionet
  • Target version set to Beta RC4

Fixed!

#5

Updated by Brian Flanagan over 3 years ago

  • Status changed from Resolved to Closed

Works with 9 Oct updates!

Also available in: Atom PDF