44
Programming with TIDE
©2000-2008 Tibbo Technology Inc.
When you define a variable, some space is reserved for it in memory; later, while
the program executes, this memory space can hold a value.
Variables are assigned values like so:
x =
15
' x is now 15.
x = y
' x is now equal to y.
str =
"foobar"
' str now contains the string 'foobar' (with no quotes).
Types of Variables
Tibbo Basic supports the following variable types:
Name
Description
byte
Hardware-level. Unsigned. Takes 1 byte in memory. Can
hold integer numerical values from 0 to 255 (&hFF).
word
Hardware-level. Unsigned. Takes 2 bytes in memory. Can
hold integer numerical values from 0 to 65535 (&hFFFF).
dword
(new in
V2.0, not
available on all
platforms)
Hardware-level. Unsigned. Takes 4 bytes in memory. Can
hold integer numerical values from 0 to 4294967295
(&hFFFFFFFF).
char
Hardware-level. Signed. Takes 1 byte in memory. Can hold
integer numerical values from -128 to 127.
short
Hardware-level. Signed. Takes 2 bytes in memory. Can
hold integer numerical values from -32768 to 32767.
integer
Compiler-level. Synonym for short; substituted for short
at compilation. Exists for compatibility with other BASIC
implementations.
long
(new in
V2.0, not
available on all
platforms)
Hardware-level. Signed. Takes 4 bytes in memory. Can
hold integer numerical values from -2147483648 to
2147483647
real
(new in
V2.0, not
available on all
platforms)
Hardware-level. Signed, in standard "IEEE" floating-point
format. Can hold integer and fractional numerical values
from +/- 1.175494E-38 to +/- 3.38. Real
calculations are intrinsically imprecise. Result of
floating-point calculations may also differ slightly on
different computing platforms. Additionally, floating-point
calculations can lead to floating-point errors: #INF, -#INF,
#NaN. In the debug mode, any such error causes an
.
float
(new in
V2.0, not
available on all
platforms)
Compiler-level. Synonym for real; substituted for real at
compilation. Exists for compatibility with other BASIC
implementations.
29