Variable types
Variant
Like Visual Basic, when a variable is introduced in BlueZone Basic, it is not necessary to declare it first (see option explicit for an exception to this rule). When a variable is used but not declared then it is implicitly declared as a variant data type. Variants can also be declared explicitly using "As Variant" as in Dim x As Variant. The variant data type is capable of storing numbers, strings, dates, and times. When using a variant you do not have to explicitly convert a variable from one data type to another. This data type conversion is handled automatically.
For example:
Sub Main
   Dim x   ' Variant variable.
      x = 10
      x = x + 8
      x = "F" & x 
   print x   ' Prints F18.
End Sub
A variant variable can readily change its type and its internal representation can be determined by using the function VarType. VarType returns a value that corresponds to the explicit data types. Refer to VarType function for more information.
When storing numbers in variant variables, the data type used is always the most compact type possible. For example, if you first assign a small number to the variant it is stored as an integer. If you then assign your variant to a number with a fractional component, it is then stored as a double.
For numeric operations on a variant variable, it is sometimes necessary to determine if the value stored is a valid numeric, thus avoiding an error. This can be done with the IsNumeric function. Refer to IsNumeric function for more information.
Variants and Concatenation
If a string and a number are concatenated the result is a string. To be sure your concatenation works regardless of the data type involved, use the & operator. The & operator does not perform arithmetic on your numeric values, it concatenates them as if they were strings.
The IsEmpty function can be used to find out if a variant variable has been previously assigned. Refer to IsEmpty function for more information.