|
Liberty BASIC Workshop Tutorial     |
STARTING A NEW CODE FILE
To start writing your own Liberty BASIC code, you can click on the "New" button, or on the File Menu and select "New". A new code window appears. Start typing your code. That's all there is to it!
OPENING FILES
If you'd like to open existing code, click the "Open" button on the toolbar, or select "Open" on the File Menu. You can browse to the file on disk that you want to open, or you can use the Code Explorer to view the first 2000 characters of code before you decide to open it. If you've never programmed in Liberty BASIC before, be sure to work through the tutorial that comes with Liberty BASIC and refer often to the Liberty BASIC helpfile. Liberty BASIC ships with many demo programs. These demos are a great place to start. You can read them and run them to see what they do. You can modify them to get familiar with Liberty BASIC syntax and structure.
PROCEDURES - BRANCH LABELS, FUNCTIONS AND SUBS
Procedures in Liberty BASIC come in the forms of branch labels, subs and functions. The branch labels, sub names, and function names are listed in the code window combobox. Click on one to scroll to that procedure in the code. You can sort these alphabetically by clicking the "Sort" button, or leave the list in the order in which they appear in the code.
LINE NUMBERS AND BOOKMARKS
The left margin of the code editing window contains line numbers to make it easy for you to find lines in your code. You can also set bookmarks with the bookmark buttons, or by right-clicking in the bookmark margins. If you put a bookmark directive in your code, Liberty BASIC Workshop sets the bookmarks for you, each time you open the file. a bookmark directive looks like this:
'bookmark
You can use the bookmark buttons to go to the previous or next bookmark. Bookmarks make it very easy to navigate back and forth through your code.
RUNNING PROGRAMS
You can run, tokenize, or debug your code using Liberty BASIC by choosing these functions from the toolbar buttons or from the "Liberty BASIC" Menu. Liberty BASIC Workshop writes to disk a copy of your code in its current state, then invokes Liberty BASIC to run the code.
SAVING CODE TO DISK
Don't forget to save your work when you close Liberty BASIC Workshop. You can use the "Save" button on the toolbar, or you can use one of the options for saving in the File Menu.
SEARCHING AND REPLACING
If you want to search for a word or phrase in the code, or if you want to replace words or phrases, click the search button on the toolbar or access the feature from the Edit Tools Menu. If you highlight a word before calling up the search dialog, it is automatically placed in the search textbox of the dialog. The search dialog remembers the words you've chosen in the current coding session. To search for one of these words or phrases again, select it from the combobox in the search dialog. You can replace a single instance of a word or phrase, or you can replace all instances in the code. It's best to choose the option to confirm each replacement if you replace all instances.
VARIABLES
There is a variable listing tool to help you manage your variables. Since Liberty BASIC does not require you to declare variables, it is easy to forget the variable names. Liberty BASIC variables are case sensitive, too. The variable listing tool not only lists each occurrence of each variable, but it also lists the line containing the variable. The list can be sorted chronoligically or alphabetically. Click on the name and Liberty BASIC Worskhop scrolls to the line of code indicated.