| Type | Suffix | Size | Range |
|---|---|---|---|
| BYTE | ? | 8-bit | 0 to 255 |
| WORD | ? | 16-bit | 0 to 65535 |
| DWORD | ? | 32-bit | 0 to 4,294,967,295 |
| INTEGER | % | 16-bit | -32,768 to 32,767 |
| LONG | & | 32-bit | -2,147,483,648 to 2,147,483,647 |
| QUAD | && | 64-bit | Very large integers |
| SINGLE | ! | 32-bit | IEEE 754 float (partial support) |
| DOUBLE | # | 64-bit | IEEE 754 double (partial support) |
| EXT | ## | 80-bit | x87 extended (partial support) |
| STRING | $ | Variable | ASCIIZ fixed-length buffer |
| WSTRING | $$ | Variable | UTF-16 (partial support) |
| CURRENCY | @ | 64-bit | Fixed-point (4 decimals) |
LOCAL name[(bounds)] AS typeDeclares a procedure-local variable. Must appear at the top of a FUNCTION or SUB before executable statements.
LOCAL x AS LONG LOCAL name$ AS STRING LOCAL price AS SINGLE
DIM name[(bounds)] AS typeDeclares a variable (equivalent to LOCAL in the current implementation).
DIM count AS LONG
STATIC name AS typeDeclares a variable that retains its value between calls to the procedure.
STATIC callCount AS LONG
GLOBAL name AS typeDeclares a module-level global variable. Partial support only.
GLOBAL g_counter AS LONG
Arrays with a compile-time constant size:
LOCAL a(10) AS LONG ' 0 to 10 (11 elements) LOCAL b(1 TO 5) AS LONG ' 1 to 5 (5 elements) LOCAL names$(20) AS STRING ' String array (limited)
Stack-backed dynamic arrays; bounds established at runtime:
LOCAL arr() AS LONG REDIM arr(1 TO n) AS LONG ' Allocate n elements arr(3) = 42 ' Element assignment x = arr(3) ' Element read
REDIM PRESERVE (preserving existing data on resize) is not yet supported. Arrays are stack-backed, not heap-allocated.
| Function | Description | Example |
|---|---|---|
LBOUND(a) | Lower bound of array | PRINT LBOUND(arr) |
UBOUND(a) | Upper bound of array | PRINT UBOUND(arr) |
| Function | Description |
|---|---|
LEN(s$) | Returns the length of a string |
STRPTR(s$) | Returns a pointer to the string data (for WinAPI calls) |
VARPTR(v) | Returns a pointer to a variable |
LEFT$(s$, n) | Returns the leftmost n characters |
RIGHT$(s$, n) | Returns the rightmost n characters |
MID$(s$, start, n) | Returns n characters from position start |
TRIM$(s$) | Removes leading and trailing spaces |
LTRIM$(s$) | Removes leading spaces |
RTRIM$(s$) | Removes trailing spaces |
UCASE$(s$) | Converts to uppercase |
LCASE$(s$) | Converts to lowercase |
s$ = "Hello" t$ = s$ + ", World" ' Concatenation with + IF s$ = t$ THEN ... ' Equality comparison IF s$ <> t$ THEN ... ' Inequality comparison IF s$ < t$ THEN ... ' Relational comparison
Partial support for structured types with numeric, STRING, and nested TYPE fields:
TYPE Point
x AS DOUBLE
y AS DOUBLE
END TYPE
LOCAL p AS Point
p.x = 3.0
p.y = 4.0
| Base | Prefix | Example |
|---|---|---|
| Decimal | (none) | 42, -100 |
| Hexadecimal | &H | &HFF, &H0A2B |
| Octal | &O | &O77, &O377 |
| Binary | &B | &B1010, &B11110000 |
| Category | Operators |
|---|---|
| Arithmetic | + - * / \ (integer) MOD ^ |
| Comparison | = <> < > <= >= |
| String | + (concatenation), = <> < > |