Line Numbers?

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

Line Numbers?

Postby HillbillyGeek » Oct 27, 2011 2:14

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 automatically assigns a number out along the left-most margin.

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

Postby TJF » Oct 27, 2011 6:57

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.
Posts: 9993
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Postby fxm » Oct 27, 2011 7:23

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).

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 9 guests