This section contains an alphabetical listing of all of the PowerBASIC keywords. Each entry goes into specific detail about each command, and is cross-references to other relevant commands. The Programming Reference topics in this help file describe theory and example usage of a selection of essential commands.
The commands can be classified into four primary categories, according to their syntactic class: functions, statements, system variables, and metastatements:
predefined PowerBASIC functions, as opposed to user-defined functions.
Functions generally return either
T = COS(3.1!)
sResult = FORMAT$(T)
A$ = CHR$(123, "hello", 65, 66, 67, 65 TO 97)
Statements are building blocks that make up programs. They instruct the compiler to perform specific actions, such as opening a file, setting the date, sending data to a device, etc. Statements do not return a value, but often take one or more arguments. Each statement must appear on a line by itself; or be separated from other program elements with a delimiting colon (:) character. For example:
A& = A& + 10& : B$ = "PowerBASIC"
OPEN "A Long Filename.txt" FOR BINARY AS #1
Count& = 100
System variables allow a program to interact with the system (in this sense, "system" means the computer, the operating system, the internal run-time code, etc). System variables are predefined by PowerBASIC, and can be used to access and control certain information maintained by the system. For example:
A$ = DATE$
DATE$ = "03-03-2003"
ErrVal = ERRCLEAR
B$ = TIME$
TIME$ = "03:00"
Metastatements are instructions that control the action of the PowerBASIC compiler. Strictly speaking, metastatements are not part of the BASIC language because they do not operate at run-time (when the program is executing). Like compiler option-switches, metastatements can be used to determine how the compiler will operate during the compilation of program code (compile-time).
Metastatements are prefixed with a number (#) symbol to differentiate them from normal statements. Metastatements may take one or more arguments. For example:
#COMPILE EXE "The target filename.exe"
Please note that PowerBASIC supports both the dollar ($) symbol and a the pound (#) symbol as a metastatement prefixes.
Format and typefaces