Table 1: The variable types supported by the QB64 language.
┌───────────────────────────────────────────────────────────────────────────┐
│ Numerical types │
├──────────────────────┬───────────┬────────────────────────────┬───────────┤
│ Type Name │ Type │ Minimum value │ Size in │
│ │ suffix │ Maximum value │ Bytes │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _BIT │ ` │ -1 │ 1/8 │
│ │ │ 0 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _BIT * n │ `n │ -128 │ n/8 │
│ │ │ 127 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _UNSIGNED _BIT │ ~` │ 0 │ 1/8 │
│ │ │ 1 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _BYTE │ %% │ -128 │ 1 │
│ │ │ 127 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _UNSIGNED _BYTE │ ~%% │ 0 │ 1 │
│ │ │ 255 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ INTEGER │ % │ -32,768 │ 2 │
│ │ │ 32,767 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _UNSIGNED INTEGER │ ~% │ 0 │ 2 │
│ │ │ 65,535 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ LONG │ & │ -2,147,483,648 │ 4 │
│ │ │ 2,147,483,647 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _UNSIGNED LONG │ ~& │ 0 │ 4 │
│ │ │ 4,294,967,295 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _INTEGER64 │ && │ -9,223,372,036,854,775,808 │ 8 │
│ │ │ 9,223,372,036,854,775,807 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _UNSIGNED _INTEGER64 │ ~&& │ 0 │ 8 │
│ │ │ 18,446,744,073,709,551,615 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ │ │ -3.402823E+38 │ │
│ SINGLE │ ! or none │ 1.175494E-38 │ 4 │
│ │ │ +3.402823E+38 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ │ │ -1.797693134862315D+308 │ │
│ DOUBLE │ # │ 2.225073858507201D-308 │ 8 │
│ │ │ +1.797693134862315D+308 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ │ │-1.189731495357231765F+4932 │ │
│ _FLOAT │ ## │ 3.362103143112093506F-4932 │ 32 │
│ │ │+1.189731495357231765F+4932 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _OFFSET │ %& │ -9,223,372,036,854,775,808 │ use LEN │
│ │ │ 9,223,372,036,854,775,807 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ _UNSIGNED _OFFSET │ ~%& │ 0 │ use LEN │
│ │ │ 18,446,744,073,709,551,615 │ │
├──────────────────────┼───────────┼────────────────────────────┴───────────┤
│ _MEM │ none │ An internal TYPE like memory variable. │
└──────────────────────┴───────────┴────────────────────────────────────────┘
For the floating-point numeric types SINGLE (default when not assigned),
DOUBLE and _FLOAT, the middle values represent the smallest possible fraction,
while the min./max. values above and below represent the limits of the
possible number range. _OFFSET dot values are used as a part of the _MEM
variable type in QB64 to return or set the position in memory.
┌───────────────────────────────────────────────────────────────────────────┐
│ Text types │
├──────────────────────┬───────────┬────────────────────────────┬───────────┤
│ Type Name │ Type │ Minimum value │ Size in │
│ │ suffix │ Maximum value │ Bytes │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ STRING │ $ │ 0 │ use LEN │
│ │ │ 2,147,483,647 │ │
├──────────────────────┼───────────┼────────────────────────────┼───────────┤
│ STRING * n │ $n │ 1 │ n │
│ │ │ 2,147,483,647 │ │
└──────────────────────┴───────────┴────────────────────────────┴───────────┘
While a regular variable length STRING may have a minimum length of zero
(empty string), the fixed length string type STRING * n, where n is an
integer length value, must have a minimum length of at least one character.
|