GoTo LABEL doesn't jump forward

Please report bugs.

GoTo LABEL doesn't jump forward

Postby blatman » Thu Aug 16, 2012 9:32 pm

Not sure whether this is design intent but needed to update a bit of old working legacy spaghetti code to avoid using GoTo LABEL.

Example::

'L998:

Dim fff As Integer
fff = 5
If fff = 5 Then
GoTo L998
Else
Dim ggg As Integer
End If

L998:

Trying to go forward to L998: produced a parsing error -
Q7Basic: syntax error or parser error - Label L998 has not been declared in line  near ' Else ' in line 195 in file modDecision.Module.q7b

If L998: is declared prior to calling GoTo command then all is OK.

Also seems that the GoTo LABEL only works within the same Sub and the label needs to start with a letter not a digit.
The Sub restriction is OK with me as I only ever used jumps as local quick and dirty connectors within objects - too many hours doing machine level coding I guess.

Cheers.
blatman
 
Posts: 49
Joined: Mon Jul 16, 2012 12:33 pm
Location: UK

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest