Liberty BASIC Help Online

Understanding Syntax
 
The documentation for Liberty BASIC commands includes command definitions in example form.  These are not to be taken literally.  The language used attempts to give intuitive labels to the command parameters.  For example, finding an "x" within a command definition doesn't meant that an actual "x" should appear there, but rather that the value desired for the x placement should appear there.  Here are some examples to explain the way it works.
 
Graphics Commands
In the following graphics command definition, the "x" and "y" are NOT variables, but placeholders for hard-coded values.
 
print #handle, "box x y"
 
In an actual program, the values required would appear within the quotation marks for the command:
 
print #win, "box 30 221"
 
To use the "x" and "y" as variables, they MUST be placed outside the quotation marks, with blank spaces preserved within quotation marks:
 
x = 30
y = 221
print #main, "box ";x;" ";y
 
See also:  Graphics Commands
 
 
Text Commands
print #handle, "!select column row";
 
Text commands must be preceded by the ! character.  If not, they will simply be displayed in the textbox, texteditor or text window as text.  In the example above, "column" and "row" are standing in for hard coded values.
 
As it might appear in a program:
 
print #win, "!select 3 4";
 
OR
 
a = 3 : b = 4
print #win, "!select ";a;" ";b
 
See also:  Text Commands
 
 
Control Commands
 
BUTTON #handle.ext, "label", [clickHandler], corner, x, y
 
In the above BUTTON command, "#handle" stands in for the window handle as it appears in your program.  The ".ext" stands in for the extension given to the control when it was created.  "label" stands in for the label desired on this button.  "[clickHandler]" stands in for the desired branch label for the event handler for this button.  "corner" stands in for the desired anchor corner, and "x, y" stand in for the actual locations.  These can be hard coded, or they can be variables.  Here are some possible BUTTON commands as they appear in a program:
 
BUTTON #main.okay, "Okay", [doOkay], UL, 10, 20
BUTTON #win.1, "Cancel", [quitMe], UL, 43, 112
 
x = 112 : y = 34
BUTTON #1.2, "Print", [printClick], UL, x, y
 
Here is another example that shows the syntax for CHECKBOX:
 
CHECKBOX #handle.ext, "label", [set], [reset], x, y, wide, high
 
As it appears in a program:
 
CHECKBOX #win.check1, "Make Backup", [setBackup],_
    [resetBackup], 300, 22, 100, 24
 
See also:  Controls


Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/