Project

General

Profile

Actions

Bug #400

open

Un-referenced line numbers sometimes cause Gosub to fail.

Added by Brian Flanagan almost 4 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Target version:
-
Start date:
06/27/2020
Due date:
% Done:

0%

Estimated time:
1:00 h
Affected version:

Description

Example:

#manifest: "pc"
#splashScreen: false
#speed: "safe"
#fps: false

Gosub 20 ' This program freezes (and produces no output) if line 5 exists, but is not referenced.
         ' If you comment line 5, both Gosubs (20 & 15) work.
Gosub 15
' Gosub 5 ' If you UN-comment this line, and leave line 5 active, then all 3 Gosubs will work.
End

5 Print "Line 5"
Return

15 Print "Line 15"
Return

20 Print "Line 20"
Return

NOTE: It doesn't have to be an un-referenced Gosub... but instead, ANY un-referenced line number.
NOTE ALSO: If the un-referenced line appears AFTER lines 10, 15, and 20, this is NOT a problem.
AND: If the un-referenced line appears before ANY of lines 10, 15, and 20, the program will fail.

HERE IS THE KEY TO SOLVING THE PROBLEM:
If an un-referenced line number appears before a referenced subroutine, the program will fail.
If you add a reference to the un-referenced line, OR you comment the un-referenced line, this will work-around the problem.

An un-referenced line number should be a WARNING only, and should NOT cause the code to fail.

Actions #1

Updated by Brian Flanagan almost 4 years ago

  • Affected version changed from 0.9.9.2 to 0.9.9.3
Actions #2

Updated by Brian Flanagan almost 4 years ago

  • Assignee set to Francois Lionet
  • Estimated time set to 1:00 h
  • Affected version changed from 0.9.9.3 to Beta RC2

One other thing I noticed is that the comments that normally appear before a line in application.js did not appear for the unreferenced line

Actions

Also available in: Atom PDF