Table 4: Data types lists the twelve data types available in BlueZone Basic.
Table 4: Data types
Variable |
Type definition |
Size |
Byte |
Dim BVar As Byte |
0 to 255 |
Boolean |
Dim BoolVar As Boolean |
True or False |
String $ |
Dim Str_Var As String |
0 to 65,500 char |
Integer % |
Dim Int_Var As Integer |
2 bytes |
Long & |
Dim Long_Var As Long |
4 bytes |
Single ! |
Dim Sing_Var As Single |
4 bytes |
Double # |
Dim Dbl_Var As Double |
8 bytes |
Variant |
Dim X As Any |
|
Currency |
Dim Cvar As Currency |
8 bytes |
Object |
Dim X As Object |
4 bytes |
Date |
Dim D As Date |
8 bytes |
User Defined Types |
|
size of each element |
Scope of variables
BlueZone Basic scripts can be composed of many files and each file can have many subroutines and functions in it. Variable
names can be reused even if they are contained in separate files. Variables can be local or global.
Declaration of variables
In BlueZone Basic, variables are declared with the Dim statement. To declare a variable other than a variant, the variable
must be followed by As, or appended by a type declaration character such as a % for Integer type.
For example:
Sub Main
Dim X As Integer
Dim Y As Double
Dim Name$, Age% ' Multiple declaration on one line.
End Sub