Line Numbers


Line numbers are optional except when a line is the target of a Goto or a Gosub. Line Numbers are included for backwards compatibility. Using line labels is the preferred method.

Line Labels


For Example:


a = 0

10 CLS

Print a
Gosub 100
Wait 500

if a < 100 then 10
End

100 a = a + 1
Return


There is only one down side to making line numbers optional. It is now harder to identify a line containing an error.

For example:

100 Rem Line 100
Rem Line 100.1
Rem Line 100.2

x = 7y5

200 Rem Line 200
Rem Line 200.1
Rem Line 200.2

The program above has an obvious syntax error and produces the following error message.




Notice the line number is (Line 100.3). This means the error is on the third non-blank line past the last line number (100).

To make things a little easier the line with the error is displayed in the message box.


Comments






Become a Patron