- Comments
Comments are non-executed lines of code which are included for the benefit of the programmer. Comments can be included virtually anywhere in a script. Any text following an apostrophe or the word Rem is ignored by BlueZone Basic. Rem and all other keywords and most names in BlueZone Basic are not case sensitive.
- Statements
In BlueZone Basic there is no statement terminator. More than one statement can be put on a line if they are separated by a colon.
- Numbers
BlueZone Basic supports three representations of numbers:
- Variable and constant names
Variable and constant names must begin with a letter. They can contain the letters A to Z and a to z, the underscore symbol (_), and the digits 0 to 9. Variable and constant names must begin with a letter, be no longer than 40 characters, and cannot be reserved words.
- Variable types
- Other data types
- Global variables
Global variables are declared outside any subroutine or function using the Dim or Global statements and are accessible throughout the entire script. In addition, when a script ends execution, Global variables are stored in the Bzshvars.ini file, located in the BlueZone working directory. Subsequent running of scripts that use referenced Global variables have their values initialized to the stored values before script execution. This allows for variable sharing across multiple instances of the script host. A Global variable must be initialized in the script if it does not want to use the stored value.
- $Include: statement
The $Include: statement can be used to insert script text contained in a separate file into the script memory block when playing and debugging scripts. This is useful if multiple scripts contain the same code. The $Include: statement must be preceded by the comment ( ‘ ) character. To comment-out an $Include: statement, use a comment at the beginning of the script line that is not part of the $Include: statement.
- Control structures
BlueZone Basic has complete process control functionality. The control structures available are Do loops, While loops, For loops, Select Case, If Then, and If Then Else. In addition, BlueZone Basic has one branching statement: GoTo. The Goto statement branches to the label specified in the Goto statement.
- Subroutines and functions
Subroutine and function names can contain the letters A to Z and a to z, the underscore symbol (_), and digits 0 to 9. The only limitation is that subroutine and function names must begin with a letter, be no longer than 40 characters, and not be reserved words.
- Calling procedures in DLLs
DLLs or Dynamic-link libraries are used extensively by engineers to access functions and subroutines located there. There are two main ways that BlueZone Basic can be extended:
- File input/output
BlueZone Basic supports full sequential and binary file I/O.
- Arrays
BlueZone Basic supports single- and multi-dimensional arrays. Using arrays you can refer to a series of variables by the same name each with a separate index. Arrays have upper and lower bounds. BlueZone Basic allocates space for each index number in the array. Arrays should not be declared larger then necessary.
- User-defined types
Users can define their own types that are composites of other built-in or user defined types. Variables of these new composite types can be declared and then member variables of the new type can be accessed using dot notation. Only variables of user defined types that contain simple data types can be passed to DLL functions expecting ‘C’ structures.
- Dialog support
BlueZone Basic has support for custom dialogs. The syntax is similar to the syntax used in Microsoft Word Basic. The dialog syntax is not part of Microsoft Visual Basic or Microsoft Visual Basic For Applications (VBA). BlueZone Basic has complete support for dialogs. The type of dialogs supported are outlined below.
- OLE Automation
OLE Automation is a standard, promoted by Microsoft, that applications use to expose their OLE objects to development tools, BlueZone Basic, and containers that support OLE Automation. A spreadsheet application can expose a worksheet, chart, cell, or range of cells all as different types of objects. A word processor can expose objects such as application, paragraph, sentence, bookmark, or selection.