By default, a variable without an identifier is set to an integer data type. To reference a long data
type, an ampersand is required. For example, the variable a is different than a&. The identifier for
an integer data type is the percent symbol, but it isn't required, so a% and a are seen as the same
variable.
String Data Types:
String data types are variables that can hold text. By default, the length of each string variable is
128 bytes. This default value can be changed in the preferences of the editor, or through the DIM, GLOBAL, and LOCAL commands.
Strings are identified by the dollar sign, and the values must be in quotations unless being
assigned by another string or string function. For example:
a$ = "Hello World"
b$ = LEFT$(a$,5)
PRINT a$, b$
|
Array Data Types:
Arrays are an indexed variable of the above listed data types and must be defined before being
used. Here's an example of using an array:
DIM a(5) AS INTEGER
a(2) = 15
PRINT a(2)
|
When using an array, using a(0) = 10 is the same as doing a = 10. This only works on the first
index.