|
Post by ogdento on Nov 26, 2019 19:32:57 GMT -5
Hi folks, I just bought a license for Liberty Basic 4.5.1 (regular, not pro) and was racking my brain trying to figure out how to turn on line numbering in the editor window. I assumed there must be an option for line numbers and I'm just not finding it, but is it actually a supported feature?
|
|
|
Post by Carl Gundel on Nov 26, 2019 23:04:57 GMT -5
Hi folks, I just bought a license for Liberty Basic 4.5.1 (regular, not pro) and was racking my brain trying to figure out how to turn on line numbering in the editor window. I assumed there must be an option for line numbers and I'm just not finding it, but is it actually a supported feature? Liberty BASIC supports line numbered code if you really want to go old school, but the editor does not show line numbers to the left like some editors. You can use a different code editor if you like. Liberty BASIC supports the use of external editors. From the help file: Using a Different Code Editor You may use a third-party editor to create and modify Liberty BASIC code. You can even write your own code editor in Liberty BASIC! In order to run the code with Liberty BASIC from another program, use the following command line switches when starting LIBERTY.EXE: -R Run a BAS file on startup -D Debug a BAS file on startup --------the following three are in the registered version only-------- -T Make a TKN file from a BAS file on startup -A Automatically Exit LB on completion of BAS file -M Minimize the Liberty BASIC editor on startup Examples: LIBERTY -R -M PROG.BAS Run PROG.BAS with editor minimized LIBERTY -T -A PROG.BAS Create a TKN file from PROG.BAS then exit LIBERTY -D PROG.BAS Run the debugger on PROG.BAS As these examples appear when written as code in a Liberty BASIC program: RUN "LIBERTY -R -M PROG.BAS" Run PROG.BAS with editor minimized RUN "LIBERTY -T -A PROG.BAS" Create a TKN file from PROG.BAS then exit RUN "LIBERTY -D PROG.BAS" Run the debugger on PROG.BAS
|
|
|
Post by ogdento on Nov 26, 2019 23:31:49 GMT -5
Hey Carl thanks very much for the quick response!
... how would one go about turning that on, or are you saying you need to use an external editor for it?
|
|
|
Post by Chris Iverson on Nov 27, 2019 1:02:13 GMT -5
That statement doesn't mean line numbers in the IDE. It literally means line numbers as part of the code, as in old-school BASIC.
10 PRINT "HELLO WORLD" 20 GOTO 10
Like that.
|
|
|
Post by Rod on Nov 27, 2019 3:30:53 GMT -5
To be even clearer, you can write line number in the IDE and the code will respect them but Liberty will not insert line numbers automatically. You have to insert them yourself.
If you looked at some of the example code and played around you would soon see that line numbers are old hat, too restrictive and completely unnecessary. Only a few line numbers were important in old code, those important numbers are replace by [labels]
|
|
|
Post by mknarr on Nov 27, 2019 10:48:59 GMT -5
If you think about it in older basics, you used goto 120. In liberty and modern basics, you use a branch label for a section of code that might look like
goto [Findanumber]
and the section of code would start with
[Findanumber] code.
Believe me, I struggled with the idea of not using line numbers until I understood the rational of using branch labels.
It make a lot mor sense that just using goto 120.
|
|
|
Post by sarossell on Nov 27, 2019 11:06:08 GMT -5
Hi folks, I just bought a license for Liberty Basic 4.5.1 (regular, not pro) and was racking my brain trying to figure out how to turn on line numbering in the editor window. I assumed there must be an option for line numbers and I'm just not finding it, but is it actually a supported feature? Liberty BASIC supports line numbered code if you really want to go old school, but the editor does not show line numbers to the left like some editors. You can use a different code editor if you like. Liberty BASIC supports the use of external editors. From the help file: Using a Different Code Editor You may use a third-party editor to create and modify Liberty BASIC code. You can even write your own code editor in Liberty BASIC! In order to run the code with Liberty BASIC from another program, use the following command line switches when starting LIBERTY.EXE: -R Run a BAS file on startup -D Debug a BAS file on startup --------the following three are in the registered version only-------- -T Make a TKN file from a BAS file on startup -A Automatically Exit LB on completion of BAS file -M Minimize the Liberty BASIC editor on startup Examples: LIBERTY -R -M PROG.BAS Run PROG.BAS with editor minimized LIBERTY -T -A PROG.BAS Create a TKN file from PROG.BAS then exit LIBERTY -D PROG.BAS Run the debugger on PROG.BAS As these examples appear when written as code in a Liberty BASIC program: RUN "LIBERTY -R -M PROG.BAS" Run PROG.BAS with editor minimized RUN "LIBERTY -T -A PROG.BAS" Create a TKN file from PROG.BAS then exit RUN "LIBERTY -D PROG.BAS" Run the debugger on PROG.BAS I can't get the -M parameter to work. It just gives me an error ["closeWindow" not understood]. It is registered.
|
|
|
Post by Gordon Rahman on Nov 27, 2019 12:17:48 GMT -5
? Out of topic?
Janet wrote a listing to transform linenumber listings into listings without linenumbers, full automatic. It only lacks the abillity to transforn the (line BASIC) ON A GOTO constructions into the newer SELECT CASE basic constructions.
I'll see if I can find her listing.
Gordon
|
|
|
Post by Carl Gundel on Nov 27, 2019 12:56:04 GMT -5
I can't get the -M parameter to work. It just gives me an error ["closeWindow" not understood]. It is registered. Looks like a bug that escaped beta testing. Sorry.
|
|
|
Post by sarossell on Nov 27, 2019 13:07:48 GMT -5
Bummer. It happens. Is there perhaps a way to include code in the .bas program to close and exit LB?
|
|
|
Post by Rod on Nov 27, 2019 14:30:27 GMT -5
"Is there perhaps a way to include code in the .bas program to close and exit LB?"
Use nomainwin close all open resources like close #w end
|
|
|
Post by sarossell on Nov 27, 2019 14:40:28 GMT -5
Much appreciated Rod!
Unfortunately, I've found that this only works if the ONLY thing I do is close the #window immediately. If I move, resize or do anything else, THEN close the window, the LB code editor returns. I was hoping for a more "medieval" liberty.exe -kill or -exit option perhaps.
Thanks!
|
|
|
Post by Rod on Nov 27, 2019 16:07:37 GMT -5
Do you mean that you want the program to run and close without ever seeing the Liberty BASIC ide (editor)? I am not tuned in yet, perhaps a very small code example to show the problem.
There is a preferences option to start the ide I think but not on my pc right now. If you run a .exe you will never see the editor if you are running a .bas or .tkn you will be brought back to the editor. .exe is the finished program. .bas and .tkn files are programs under development that normally need the editor.
bit more info needed.
|
|
|
Post by sarossell on Nov 27, 2019 16:13:19 GMT -5
Sorry if this got a little off topic. All of my efforts here are for the smoother use of the Sublime Text Editor which provides line numbers as originally requested. ...
I found the solution.
run "tskill /a liberty"
closes all instances of liberty.exe.
Also, to fix the minimize (liberty -M prog.bas) bug, I start Liberty Basic with the Sublime build command:
"shell_cmd": "start /min c:/Progra~1/Libert~1/liberty.exe -r $file"
You can also use a batch file:
@echo off start /min "C:\Program Files\Liberty Basic\" liberty.exe -r %1
|
|
|
Post by Brandon Parker on Nov 27, 2019 16:50:33 GMT -5
One thing I would really like to see is a command-line switch to run Liberty BASIC IDE hidden & tokenizing a file but show the IDE on a failure to compile. The compile progress window remaining front & center would be fine for compile progress reference. This is something I was looking to do with the command-line switches when I first created my precompiler, but I got over not being able to do it natively.
{:0)
Brandon R. Parker
|
|