LB Booster is a powerful utility for Liberty BASIC
programmers. With LBB you can:
LB Booster is Freeware;
you are encouraged to purchase the full version of Liberty Basic on which to develop,
test and debug your programs prior to 'boosting' them.
- Speed up a Liberty BASIC program by up to ten times.
- Compile a Liberty BASIC program to a compact, standalone executable.
- Overcome many of Liberty BASIC's bugs and limitations.
Here are some examples of the benefits offered by LB Booster:
- Speed is typically increased. For example the ELAPSED.bas program supplied with LB
reported an execution time of approximately 2400 milliseconds under LB4 and 200 ms under LBB
(twelve times faster) and the SIEVE2.bas program ran in about 250 ms under
LB4 and 30 ms under LBB (more than eight times faster).
- Executables are much smaller. For example the supplied example program ContactMgr424.bas,
when compiled with LB4 (using the Create Application menu selection), created ten files totalling over
2.8 Megabytes. The same program compiled using LBB created a single file executable
of 120 Kilobytes (more than 20 times smaller).
- Floating-point numbers have an increased range (from less than 1E−4000 to more than 1E+4000) and
precision (approximately 19 significant figures).
- Executables include the necessary manifest to make them fully Vista,
Windows 7 and Windows 8 compatible.
- Executables include a VERSIONINFO resource, which can be edited by the user.
- Executables can have a multi-format icon (e.g. with different sizes and bit depths); LB4
supports only 32x32 16-colour icons.
- LBB and its executables run successfully even if DEP (Data Execution Prevention) is fully enabled.
- Compiled executables are much more secure. The TKN files generated by LB4 are easily reverse-engineered to
recover the BASIC program, and even your LB User Name and Password!
- Resource files may be embedded in the executable, and will be automatically extracted when it is run.
- You may compile your program as a Console Application, e.g. for running from a command prompt.
- The PRINTERDIALOG works correctly.
- The FILEDIALOG does not impose a path
length limitation of 128 characters and the 'tooltips crash' doesn't occur.
- SPRITECOLLIDES works correctly when one or both sprites have been scaled,
centered, or have an offset applied.
- TIMER does not cause the PROMPT statement to misbehave.
- You can successfully pass a global variable as a parameter to a SUB or FUNCTION.
- SORT and string comparisons use the conventional ASCII character sequence,
and repeating a sort leaves the order unchanged.
- The TIMER statement can specify a subroutine to be called, instead of a label (this
option does not work correctly in LB 4.04).
- Recursion works reliably (in LB 4.04 it may not work when compiled to an EXE).
- Alt-key shortcuts for pushbutton controls are correctly underlined when
the Alt key is pressed (in LB 4.04 this works for menus, but not for buttons).
- The INPUT statement will accept a string variable as the prompt (the Liberty BASIC Help
file says this works, but it doesn't in LB 4.04).
- The RND function is improved compared with the LB 4.04 version, and doesn't suffer from bias.
- LBB is immune from the Windows 8.1 touch screen issue which can crash LB 4.04 when the screen is touched.
- Several other LB 4.04 bugs are fixed in LB Booster.
- You can change the printer font within a page. If you assign a new value to
PrinterFont$ it will immediately affect subsequent output with LPRINT, allowing you
to mix different fonts and styles (e.g. bold) on the same sheet.
- You can change the current printer (used by LPRINT and the graphics command 'print') by setting
PrinterName$ to the name of the printer, e.g. PrinterName$ = "DoPDF v7".
- A new statement PAGESETUPDIALOG is implemented. This displays the standard Page Setup
dialogue box, which allows the user to select the margins and paper orientation (portrait or landscape) that
will be used by a subsequent LPRINT.
- Graphics 'stick' (i.e. automatically get redrawn when a window is restored or uncovered)
without any extra effort by the programmer.
- The TEXTEDITOR control can be configured for word-wrap using STYLEBITS (LB4's TEXTEDITOR
does not support word-wrap at all).
- The unary minus is supported. For example the statement 'y = −x' is valid in LBB.
- USING() supports a much wider range of options than the LB4 version, including trailing minus, leading or trailing plus, leading asterisks, currency ($ and £), thousands separated by commas
and scientific notation.
- DATE$ can return the date in many additional formats, such as European day-month ordering,
hyphen delimiters or the month as an abbreviation. For example
PRINT date$("dd/mm/yyyy") or PRINT date$("dd-mmm-yyyy").
- Array elements and structure members can be read directly from a DATA statement, e.g. READ array(i),
and can be passed by reference to SUBs and functions.
- An entire array may be passed as a parameter to a function or subroutine, making it possible to
write general-purpose routines which operate on the contents of any specified array.
- LOADBMP accepts a wider range of BMP files than LB4, including files created by Photoshop and GIMP.
- The HWND(#handle) function has been extended to work with files and communication
ports as well as windows. It returns the native Windows file handle, making it possible to use
file-related API functions on files opened in LBB.
- The background colour of (for example) a STATICTEXT control may be selected independently
of the background colour of its parent window, by changing the value of the BackgroundColor$
variable in between.
- EXIT can exit from nested loops. For example if a FOR...NEXT loop is nested inside a DO loop,
an EXIT DO used within the FOR...NEXT loop will exit both loops.
- Sprites can have a linear transparency (alpha mask), allowing the background to show through to varying
- Unicode text is supported in the mainwin and when outputting to the printer using LPRINT.
There is also partial support for displaying Unicode in a GUI control, with the help of some API code.
- Anywhere you can specify a colour using one of the preset names (e.g. "brown") you can alternatively
specify it using an RGB value (e.g. "0 127 200"). LB4 doesn't allow you to set a GUI colour (e.g.
BackgroundColor$) that way.
- OPEN can open a parallel port (e.g. open "LPT1:" for output as #lpt), for example in
order to send data to a printer that does not have (or need) a printer driver.
- A window of type WINDOW can have a default button (which is 'pressed' when you use the Enter key).
In LB4 only a window of type DIALOG can have a default button.
- MAPHANDLE can be used with child controls as well as with windows. This allows, for example,
the creation of multiple child controls in a loop, something you cannot normally achieve in LB4.
- A TEXTEDITOR control can be used in a DIALOG window, allowing entry of multi-line
text (the Enter key moves the cursor to the next line rather than activating the 'default' button).
- The GETBMP command can 'see' graphics which are outside the currently
visible window, so if you have a scrollable graphics window you can get its entire contents into a bitmap.
- The !contents? command also works with STATICTEXT controls.
- The !autoresize command also works with TEXTBOX and LISTBOX controls.
- You can create three- (and more) dimensional arrays using DIM, for example
DIM array$(1,2,3,4), but you cannot subsequently resize the array using REDIM
(you can, however, use REDIM simply as a means of emptying the array).
- A %mode directive optionally enables a standard INT function and
conventional precedence of AND over OR.
- An 'include' directive supports splitting up a large program into modules, and the use of code libraries.
The syntax is: 'include filename.bas.
Create a suitable directory (e.g. C:\Program Files\LBB\) and copy the
LBB.exe file there. You will need administrative privileges to copy the file
and when you execute it for the first time (in Windows Vista™,
Windows 7™ and Windows 8™ use Run
as administrator); however it can be run from a normal user account thereafter.
You can, if you wish, create a desktop shortcut to the program by right-dragging
the LBB.exe file to your desktop and selecting 'Create shortcut here' from
the menu that appears when you release the mouse button. You can create a shortcut
in your Start Menu in a similar way.
LBB requires Windows 2000 or later. It is not compatible with Windows 95, Windows 98 or Windows Me.
Sprites require a CPU with 'integer SSE' support, i.e. an Intel Pentium III or an AMD Athlon or later.
Although LBB can successfully boost most Liberty BASIC 4 programs, there
are a few incompatibilities, including:
In general, LBB may not always tolerate coding errors or weaknesses even if Liberty BASIC itself does. However in the case of an
incompatibility from this cause it will usually be possible to modify the program so that it works under LBB
as well as LB4. See Troubleshooting for some examples.
- There are no graphics segments; the 'delsegment' and 'segment' commands
are ignored. However, on the plus side no special measures are required to make
graphics 'stick'; if your program suffers from this problem under LB4 it won't when
run under LBB!
- LBB does not support arbitrary precision arithmetic; integers (whole numbers) are limited
to the range −18,446,744,073,709,551,615 to +18,446,744,073,709,551,615.
Values outside this range will be stored as floating-point numbers and accuracy may suffer.
In addition, the bitwise operations
AND, OR and XOR work only with 64-bit integer values.
- The EVAL function works only with simple expressions containing 'standard' BASIC
functions, and may fail if the expression contains variable names starting with a keyword.
EVAL doesn't work if the expression contains a structure member, or a function name in mixed-case (e.g. Sqr).
- Handle variables are assumed always to refer to windows or controls, not to files or other
- When printing a window, the resulting quality on the printer is no better than it is on the
screen (but see here).
- The size of the 'canvas' onto which you can draw in a graphics box is limited (the width is
limited to the width of your screen display). You can increase it using the horizscrollbar
and/or vertscrollbar commands.
- The mainwin can hold only about 84 lines of text; if more lines are output the remainder
will be 'scrolled off' the top of the window and lost. Also, the mainwin has no menu. You can copy
the contents of the mainwin onto the clipboard by typing Ctrl+Tab.
- If one of the keypad number keys is pressed, two 'when characterInput' events are
generated. One is the regular event that LB4 generates, and the other is a 'special key' event (LEN(Inkey$)=2).
This makes it possible to distinguish the keypad from the regular number keys.
- The syntax for serial port parameters is slightly different. The basic options are
the same, so for example this works:
open "COM1:9600,n,8,1" for random as #comm
but when specifying 'handshaking' parameters the syntax accepted by LBB is as follows:
open "COMn: [baud=b] [parity=p] [data=d] [stop=s]
[to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off]
[dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]"
A full description of these parameters can be found
- In a single-line IF statement LBB may behave differently from LB4 if there are multiple (cascaded) IFs and an ELSE clause. To resolve this recast the code as nested multi-line IFs.
RESUME resumes execution at the line (not statement) where the error occurred; if
in doubt use only one statement per line. Also, RESUME must be used within the scope of the SUB
or FUNCTION (if any) in which the error occurred.
- Opening a file in BINARY mode does not prevent PRINT outputting a newline (CRLF).
To suppress the newline add a trailing semicolon (;) to the PRINT statement; this will not affect the operation
of the program in LB4.
- The maximum length of a DATA statement is approximately 250 characters.
If, exceptionally, the only way to achieve compatibility is to use different code for LB4 and LBB you can test which
platform your program is running under as follows:
if instr(Platform$, "LBB") then
print "Running under LBB"
print "Running under LB"
LB Booster accepts the following Compiler Directives in the source code of the BASIC
program; they are case-sensitive:
This directive, which takes the form of a special comment, includes the specified file at the point
in the program where the directive is inserted; note that there must not be a space after the
apostrophe. This allows you to develop and test separate code modules which can then be
incorporated in programs whenever they are required.
For maximum compatibility with Liberty BASIC
Workshop the 'include directive is ignored when it is at the very beginning of the
program. See this
Wiki article for more information, and for details of how to integrate LBW with LBB.
This directive causes LBB to evaluate the INT() function, and expressions
containing both AND and OR operators, in a standard way; note that there must
not be a space after the percent sign. Specifically the INT function truncates towards minus infinity
(e.g. INT(−3.5) is −4) and OR has a lower precedence than AND
(e.g. 1 OR 2 AND 4 is 1).
This directive (which is the default) causes LBB to evaluate the INT() function, and
expressions containing both AND and OR operators, in the non-standard
Liberty BASIC 4 way. Specifically the INT function truncates towards zero
(e.g. INT(−3.5) is −3) and OR has the same precedence as AND,
i.e. they are evaluated strictly left-to-right (e.g. 1 OR 2 AND 4 is 0).
If a line starts with an exclamation mark (!) the rest of the line is assumed to consist of
BBC BASIC code and is passed, unmodified, to the output of the translator. This facility should be
used with care since only a subset of BBC BASIC statements may be safely used. For example
red text may be output to the mainwin as follows:
print "This is red"
When you start LBB you are presented with a conventional window containing
the normal features which make up the Windows™ Graphical User Interface:
a title bar, a set of drop-down menus,
a toolbar and a status bar.
The main part of the screen is an editing pane in which the BASIC program
appears and can be edited. This pane can be scrolled horizontally and vertically as necessary.
LBB will accept parameters on the command line in a similar fashion to Liberty BASIC.
If a filename is specified, it is automatically loaded; this allows you to drop
a .BAS file onto the LBB icon, or to associate the .BAS file extension with LBB.exe.
The following command line switches are accepted:
|-R||Run a BAS file on startup|
|-D||Debug a BAS file on startup|
|-T||Translate and tokenise a BAS file to an LBB file|
|-C||Translate and compile a BAS file to an EXE file|
|-A||Automatically exit LBB on completion|
|-M||Minimise LBB on startup|
LBB program.bas (loads the program)
LBB -R -A -M program.bas (runs the program)
LBB -T -A -M program.bas (generates program.lbb)
The title bar contains the name of the application and its version number,
the name of the current BASIC program (or 'untitled' if the New
command has been issued), a minimise button, a maximise button
and a close button. If you right-click in the title bar you will get a
context menu containing the Restore, Move, Size,
Minimize, Maximize and Close items.
The menu bar contains the drop-down menus
File, Edit, Run,
Options and Help. These menus
may be activated by clicking on the appropriate menu name or by using a
keyboard shortcut (hold down Alt and press the key corresponding to the underlined
character). When a menu is opened a brief description of the highlighted item is
displayed in the status bar. Menu items are 'greyed
out' if they are not functional in the current circumstances.
The toolbar provides easy access to the most common commands, without
having to select them from the drop-down menus, simply by clicking
on the appropriate button. The commands for which buttons are provided are as follows:
From the File menu: New,
Load, Save and Print.
From the Edit menu: Undo, Cut,
Copy, Paste, Find and
From the Run menu: Run Program,
Debug Program and Make Executable.
Toolbar buttons are 'greyed out' if they are not functional in the current circumstances.
When a menu item is highlighted, the status bar displays a brief description of
the function of that command. Otherwise, the status bar displays the version number
and copyright information for LB Booster.
At the right-hand end of the status bar is displayed the number of the line containing the
text cursor (caret), starting at line 1. This can be useful in locating the line which is responsible
for a run-time error (the error message usually includes a line number).
The File menu contains the items New, Load,
Save, Save As, Page
Setup, Print, Recent files and Exit.
The File menu can be accessed by clicking on its name in the menu bar
or by means of the keyboard shortcut Alt-F.
The New command (keyboard shortcut Ctrl+N) deletes the current BASIC program from
memory, giving you a 'clean sheet' into which to load, paste or type a new program. If the current
program has been modified and not saved, you are first prompted to save it.
The Load command (keyboard shortcut Ctrl+L) loads a Liberty BASIC program into memory.
The file must be in plain text (ASCII) format and should ideally have been tested on, and
saved from, the full version of Liberty BASIC
to ensure it does not contain any syntax errors. The file will normally have the extension .BAS.
If the current
program has been modified and not saved, you are first prompted to save it.
The Save command (keyboard shortcut Ctrl+S) saves the current BASIC program,
replacing the original file; it is enabled
only if the program has been modified since it was loaded. If you have made changes which might be
incompatible with Liberty BASIC 4 you are advised to save the program under a new name (see
Save As below).
The Save As command saves the current BASIC program under a new name, or in a new location.
It is useful for making a backup copy, or to avoid modifying the original program if a change has been
made which might be incompatible with Liberty BASIC 4.
The Page Setup command allows you to configure the paper size, orientation (portrait or
landscape) and margins used when you print out the BASIC program. You can also use
this command to select a different printer.
The Print command (keyboard shortcut Ctrl+P) creates a hardcopy printout of the current
The nine most-recently loaded programs are listed, and can be re-loaded simply by clicking
on the appropriate entry or by using the keyboard shortcut Alt-F followed by the digit 1 to 9.
When one of the entries is highlighted, the full pathname of the file is displayed in the Status Bar.
If the previous program was not saved, you are first prompted to save it.
The Exit command quits from LB Booster and closes its window. If modifications
have been made to the program and not saved, you are first prompted to save it. If BASIC programs
are still running (and therefore using up Windows resources and potentially wasting CPU time) you
are prompted to terminate them.
The Edit menu contains the items Undo, Cut,
Copy, Paste, Delete,
Select All, Find,
Find Next and Replace.
The Edit menu can be accessed by clicking on its name in
the menu bar or by means of the keyboard shortcut Alt-E.
The Undo command (keyboard shortcut Ctrl+Z) reverses the effect of the last editing operation.
Multiple operations can be undone.
The Cut command (keyboard shortcut Ctrl+X) transfers any selected text to the clipboard, and
deletes it from the program. If no text is selected, the Cut command is inhibited.
Once the selected text is in the clipboard, you can Paste
it either elsewhere in your BASIC program or into any other application which
supports pasting of text from the clipboard. Any previous contents of the clipboard
are discarded. Selected text is highlighted in reverse-video.
The Copy command (keyboard shortcut Ctrl+C) transfers any selected text to the clipboard,
but unlike Cut it leaves the text in the BASIC program.
If no text is selected, the Copy command is inhibited.
Once the selected text is in the clipboard, you can Paste
it either elsewhere in your BASIC program or into any other application which
supports pasting of text from the clipboard. Any previous contents of the clipboard
The Paste command (keyboard shortcut Ctrl+V) inserts the contents of the clipboard into
the BASIC program at the current position of the text cursor (caret).
If the clipboard contains no text, the Paste command is inhibited. You
can use Paste to transfer a block of code from elsewhere in your BASIC
program, or to insert a block of code which has been placed in the
clipboard by any other application.
The Delete command deletes any selected text, without copying
it into the clipboard. Text which is deleted can only
be recovered by using the Undo command.
The Select All command (keyboard shortcut Ctrl+A) selects the entire BASIC program.
It is useful if you want to transfer the program into another application (e.g. a word processor) via the clipboard
The Find command (keyboard shortcut Ctrl+F) allows you to search your program for
the occurrence of some specified text. The command opens the Find dialogue box
into which you can type the text you wish to search for. You can also specify whether
the case (capitals or lower-case) is significant and whether to match only an entire
word. The search begins at the position of the text cursor (caret) when the Find command
was issued. If you want to search the entire program, ensure that you move the cursor
to the start of the program before issuing the command.
Once the Find dialogue box has been dismissed, you can
continue to search for the next and subsequent occurrences of the search string
by using the Find Next command or by pressing F3. If the text
is not found before the end of the program the message "Text not found" is
displayed; selecting Find Next again causes the search to restart from the beginning
of the program.
The Replace command (keyboard shortcut Ctrl+R) allows you to search your program for
the occurrence of some specified text and then, optionally, replace it with some
different text. The command opens the Replace dialogue box
into which you can type the text you wish to search for and the text you want it to
be replaced with. The search begins at the position of the text cursor (caret) when the Replace command
The Run menu contains the items Run Program,
Debug Program, Profile Program,
Make Executable, Make *.LBB file
and Kill BASIC Programs. The Run menu can be accessed by
clicking on its name in the menu bar or by means of the
keyboard shortcut Alt-R.
The Run Program command firsts 'boosts' (translates) the current BASIC program
and then runs it. If an error occurs during the translation process, a message is reported
and the process is aborted (once the error message is dismissed the line which resulted
in the error is highlighted). If the program has already been translated, it is simply run.
If no program is loaded, the command is inhibited.
The Debug Program command firsts 'boosts' (translates) the current BASIC program,
if necessary, and then runs it with debugging aids enabled and any breakpoints activated.
See Debugging for details.
The Profile Program command firsts 'boosts' (translates) the current BASIC program,
if necessary, and then runs it with profiling enabled. Whilst profiling, the currently-executing
line is highlighted in the editing pane (as when debugging). When the program terminates, a
Profiler Report is generated and displayed in your default text-file viewer; this shows
the approximate number of milliseconds, and percentage of the total time, spent in each program line.
The Make Executable command firsts 'boosts' (translates) the current BASIC program
(if necessary) and then 'compiles' the program to a compact, standalone executable file (typically less
than 150 Kbytes in size). The executable may run a little faster than when using the
Run Program command. If no program is loaded, the command is inhibited.
You are prompted to supply a filename and location for the executable; by default it will be stored
in the same directory as the Liberty BASIC program but with the extension '.exe'. LBB incorporates
a manifest in the executable, to enable the use of Windows XP Visual Styles
and improve compatibility with Windows™ Vista, Windows™ 7 and Windows™ 8.
The following additional options are available:
- The program's icon may be changed by clicking on the Change Icon button in the dialogue box.
You can select an icon either from an existing executable file, or from a separate icon file (for example
as produced by an icon editor). If the file contains a number of different icons, you can select the one
you want to use. Please respect Copyright, and use only an icon which you have generated yourself
or have legitimately obtained for this purpose.
If the selected icon contains multiple variants with different resolutions (e.g. 16x16, 32x32, 48x48)
and/or different colour depths (e.g. 8 bits, 32 bits) all the variants will be stored in the compiled
executable file. The version used will be the one most suited to the current display settings.
Note that such an icon can significantly increase the size of the executable.
- You can embed resource files needed by your program, for example bitmap files or sound
files; these will automatically be extracted when the executable is run. This may make it unnecessary to
use a separate installer utility, and can be particularly useful in allowing your program to be run directly
from a website. Do not incorporate files which your program needs to modify, since any
changes will be overwritten the next time the program is run!
To embed resource files in the executable click the Add button; you may select multiple files. The
files can be either in the directory containing your program, or in a subdirectory (the subdirectory
will be created when the program is run, if necessary). To remove resource files highlight them in the
list and click Remove. Note that if your program is installed in a 'protected' location, administrative
privileges will be required the first time it is run, to allow the embedded files to be extracted; thereafter it may
be run normally.
To embed resource files which will be extracted to the target PC's temporary directory (%TEMP%) - or a
subdirectory thereof - click the Add Temp button. The files must be copied to your own temporary
directory before the program can be compiled, but you are likely to want to do that anyway for the purposes
of testing in the IDE.
- You can create a Console Application by selecting the checkbox. Such an application uses
the console terminal instead of the mainwin; output which would normally go to the mainwin
will instead go to the console (stdout) and input which would normally be entered in the mainwin will instead
be read from the console (stdin); note that the LOCATE statement does not work.
To forcibly close a console application type Ctrl+Break.
- You can edit the Version Information which will be embedded in the executable. There are three
checkboxes (Debug, Patched and Prerelease) and eight text fields. Two
of those fields (File version and Product version) are expected to contain a
numeric version number in the format n.n.n.n (e.g. 126.96.36.1998); if you use a different format a
warning is issued but the creation of the executable proceeds normally.
Unlike Liberty BASIC, LBB compiles directly to an EXE so it isn't normally necessary to create a
'tokenised' program file; however the Make *.LBB file command allows you to do so if you wish.
A tokenised LBB file must be executed using the run-time engine LBBRUN.exe (rather as
LB's TKN files must be executed using RUN404.exe). Note that tokenised files are less secure
than compiled executables so it is best not to use them if you want to keep your program confidential.
The Kill BASIC Programs command terminates any BASIC programs which are still executing
in memory after having been run during this LBB session. If a BASIC program doesn't
properly exit (e.g. because of omitting a TRAPCLOSE command) it may have no visible window
yet be using up Windows resources and CPU time. If no programs are still running, the command is
In the current version of LBB you cannot choose which programs to kill.
The Options menu contains the items Show LBB Pane,
Emulate Slicing, Unicode Support,
Set Font and Set Printer Font. The Options
menu can be accessed by clicking on its name in the menu bar
or by means of the keyboard shortcut Alt-O.
The Show LBB Pane command alternately enables and disables a 'split window' mode
in which the original Liberty BASIC program is displayed in the left-hand pane and the translated
program is shown in the right-hand pane. This may be useful for diagnostic purposes
or simply for interest.
The Emulate Slicing command alternately enables and disables the full emulation
of Liberty BASIC's LEFT$, MID$ and RIGHT$ functions when the
length parameter is negative. In that case LB4 returns an empty string.
Since emulating the negative-length case significantly slows execution of the functions, and
since very few programs rely on this behaviour, it is not enabled by default.
The Unicode Support command alternately enables and disables partial support for
Unicode output. When this option is selected foreign-alphabet literal (quoted) strings may be included
in a program, and will display correctly in the mainwin and when output to a printer
using LPRINT. Unicode strings may also be displayed in GUI controls (except TEXTEDITOR
controls), with the assistance of a little API code.
The Set Font command selects the font used to display the BASIC program on
the screen. The default is the System Fixed Font (FixedSys).
The Set Printer Font command selects the font used when a hardcopy printout of the
BASIC program is generated.
The Help menu contains the items Help Topics,
Email, Website, Discussion
Group, Message Board, Wiki and
About LB Booster. The Help menu can be accessed by clicking on its
name in the menu bar or by means of the keyboard shortcut Alt-H.
The Help Topics command (keyboard shortcut F1) displays this Help documentation.
The Email command opens your default mail program (if any) so that you can send
a message to request help or information about LB Booster.
The Website command opens your default web browser (if any) and automatically
directs it to the LB Booster home page.
The Discussion Group command takes you to the LBB Yahoo!™ group, where you
can seek help and advice, report bugs, download (or upload) useful utilities and learn about
new developments in LB Booster.
The Message Board command takes you to the LBB Conforums message board, where
you can take part in discussions about LB Booster.
The Wiki command takes you to the LB Booster Wiki, where you will find articles on all
aspects of using LBB.
The About LB Booster command displays information about LBB,
including the version number and copyright information.
LB Booster incorporates a debugger, to help you locate faults in your programs. To activate the debugger either click on the 'beetle' button in the toolbar or select 'Run... Debug Program' from the menu (keyboard shortcut Alt+RD). This will translate (if necessary) and then run your program, but execution will pause at the first statement (which will be highlighted in the editing pane).
A small, resizable, debugging window will open, having a toolbar and a scrollable listbox. The listbox displays the variables in your program, updating as their values change and new ones are created. Initially it will contain the 'reserved' variables (e.g. DefautDir$ and Drive$) and any globals defined in your program. If you want to monitor the value of a specific variable you can click on it; it will then be highlighted and the list will be scrolled automatically to keep it in view. To deselect that variable click in the title bar of the debugging window.
The toolbar contains 'Resume', 'Pause', 'Step into' and 'Step over' buttons (hovering your mouse over a button will indicate its function in a tooltip). 'Resume' causes execution of the program to continue at full speed until it encounters a WAIT or TRACE 2 statement, stops to receive user input (e.g. INPUT or PROMPT), hits a breakpoint (see below) or the 'Pause' button is clicked. If your program executes a WAIT statement whilst in a paused state, you may need to 'unpause' it (click on 'Resume') and pause it again before it will respond to an event such as a TIMER tick, button press etc.
The 'Step into' and 'Step over' buttons are active only when the program is paused. 'Step into' causes a single statement to be executed; you may find that some statements require it to be clicked more than once. If the statement transfers control into a function or subroutine 'Step into' will cause execution to pause within that module. 'Step over' causes execution to pause again only on the next line, so if the statement transfers control into a function or subroutine it will run at full speed until it returns, and if the statement terminates a loop (e.g. a NEXT or WEND) execution will continue at full speed until the loop is complete. It is not usually desirable to use 'Step over' on an END FUNCTION, END SUB or RETURN statement.
You can insert temporary breakpoints in your program by double-clicking in the left margin of the editing pane, a small square will appear there as a marker; to remove the breakpoint double-click again (to clear all breakpoints right-click in the
margin and select the appropriate menu item). When a breakpoint is encountered during execution the program will pause, as if you had clicked on the 'Pause' button in the debugging window's toolbar; breakpoints have no effect if you use Run rather than Debug. Breakpoints are linked to the line number, so if you insert or delete any lines above a breakpoint it will move in relation to the code. You cannot add or remove breakpoints once the program is running.
A 'permanent' breakpoint can be inserted by means of a TRACE 2 statement; this has the same effect as a temporary breakpoint but can be saved as part of the program. It will only pause the program when you are debugging it, but you are recommended to remove TRACE 2 statements once your program is fully tested since their presence may cause execution to be slowed slightly. Note that TRACE 1 has a different function in LB Booster from that in LB 4.04: it causes line numbers to be logged to the mainwin during execution. LBB has no equivalent of LB's animate mode, since the variable list and statement highlighting continue to be refreshed even when the program is running at full speed.
Here are some hints for how to get the best from LB Booster:
- Be careful with the order in which you issue graphics commands. For example this works
in LB4 but not in LBB:
Changing the code to this makes it work properly with both LB4 and LBB:
#main.df, "Getbmp BitmapName 0 0 240 100"
#main.df, "Drawbmp BitmapName 0 0; Flush"
#main.df, "Getbmp BitmapName 0 0 240 100"
#main.df, "Drawbmp BitmapName 0 0; Flush"
- Compatibility with LBB may be impaired if you draw graphics using the Windows API, without
periodically executing a wait statement. For example, rather than calling the Sleep API
(or simply having an 'infinite loop' containing a scan statement) use a
timer 40, [loop]
' do the graphics drawing here
- If you receive the error message 'Bad use of array' check that your program doesn't
attempt to access an array before it is DIMensioned. This code, taken from FreeForm404.bas,
runs (but doesn't do anything useful) under LB4, but LBB reports an error:
- If you receive the error message 'Handle used for incompatible devices' it means you
have used the same handle name for both a file and a window (or a DLL and a window, etc.). LBB
needs each handle name to refer to only one kind of device. To fix the problem change one of the handles.
- If you receive the error message 'Duplicate structure with ambiguous member' it means
you have used the same name for two different STRUCTs, which share a member having
the same name but a different type. To fix the problem change one of the structure or member names.
- If your program uses string slicing (i.e. the LEFT$, MID$ or RIGHT$ functions),
and it is giving unexpected results, try selecting Emulate Slicing in the Options
For those who may be interested, here is a technical description of how LB Booster works.
LBB is a hybrid translator and emulator. The translator automatically converts
Liberty BASIC syntax to the equivalent
BBC BASIC syntax. This translation takes place when
you first issue the Run Program or Make Executable
The emulator (LBLIB) implements at run-time those aspects of Liberty BASIC which aren't part
of the standard BASIC language and which have no direct equivalent in BBC BASIC; principally these are the
Graphical User Interface elements (windows, controls, graphics and sprites). The emulator is
itself written in BBC BASIC.
When you issue the Make Executable command LBB creates a single-file
standalone executable containing the BBC BASIC for Windows run-time engine, the LBLIB emulator
and a tokenised/compressed version of the translated BASIC program.
LB Booster is thought to be free from serious bugs, and it is highly unlikely that
it could do any harm to other software or systems. However there is NO warranty that it
will not and its use is at your own risk.
LB Booster is the Copyright © 2014 of R. T. Russell.
BBC BASIC for Windows is the Copyright © 2001-2013 of R. T. Russell.
The name BBC BASIC is used with the permission of the British Broadcasting Corporation.
Liberty BASIC is the trademark of Carl Gundel trading as Shoptalk Systems.
Liberty BASIC Workshop is the Copyright © 2010 of Alyce Watson.
The aPLib compression library is used
with permission. Copyright © 1998-2009 by Joergen Ibsen, All Rights Reserved.
Richard Russell 2014