Consecutive Branches are invalid

From Liberty BASIC Family
Revision as of 14:22, 14 September 2020 by StPendl (talk | contribs) (Text replacement - "Bug Tracker Categories" to "Bug Tracker")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

Branch labels must head up a block of code, even a rem statement. If they don't and you list one [Branch Label] above another [Branch Label] Liberty will become confused when an event fires. It will appear to run normally from the IDE but if you run the code in debug or tokenise the code the error will show. This is a timer example but a button press event will display the same error.

Example code to demonstrate the bug.

[start]
[anotherlabel]
    for k=1 TO 10
        print k
    next
    timer 200,[start]
    wait

Example code to work around the bug.

[start]
    ' this simple rem statement solves the problem
[anotherlabel]
    for k=1 TO 10
        print k
    next
    timer 200,[start]
    wait