Line Numbers?

New to FreeBASIC? Post your questions here.
Post Reply
HillbillyGeek
Posts: 50
Joined: Oct 27, 2011 1:51
Location: Texas
Contact:

Line Numbers?

Post by HillbillyGeek »

Hi all,

While I'm not new to BASIC....I am new to FreeBasic........

back in the Stone Ages, we'd assign line numbers, e.g.:
10 blah-blah
20 blase-blase
30 GOTO10 .................etc. etc.

Can you do that in FreeBasic? I notice that within the FBide.....it automatically assigns a number out along the left-most margin.

By the way: glad to be here!
HG
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

Hi HillbillyGeek, wellcome at the forum.

Yes, you can use code like

Code: Select all

#LANG "deprecated"

10 ?"Hello"
20 GOTO 10
I recommend to get rid of this old constructs. Try to learn modern flow controls like DO : ... : LOOP and SUBs/FUNCTIONs.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Post by fxm »

FreeBASIC supports two types of line identifiers, ALTHOUGH THEIR USE IS NOT RECOMMENDED (see previous post of TJF):

Alphanumeric line labels:
- Must start with a letter.
- Must be followed by a colon.

Line numbers:
- Only valid in -lang deprecated or fblite or qb.

You can mix alphanumeric labels and line numbers in the same program.

Using FBIde, you must enter manually each line identifier (no more automatic proposed line numbering as with empiric BASIC line editor).
Post Reply