45
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
string
Hardware-level. Takes up to 257 bytes in memory (max
string size can be defined separately for each string
variable). Strings can actually be up to 255 bytes long but
always begin with a 2-byte header -- 1 byte specifies
current length, and 1 byte specifies maximum length. Each
character is encoded using an ASCII (single-byte) code.
boolean
Compiler-level. Intended to contain one of two possible
values (true or false). Substituted for byte at compilation.
user-defined
structures
(new
in V2.0)
Each user-defined structure can include several member
variables of different types. More about structures
.
user-defined
enumeration
types
Compiler-level. These are additional, user-defined, data
types. More about these under
.
Hardware-level types are actually implemented on the machine which
is used to run the final program produced by the compiler.
Compiler-level types are substituted by other variable types on
compile-time. The actual machine uses other variable types to
represent them; they are implemented for convenience while
programming.
4.2.4.2
Type Conversion
Variables can derive their value from other variables; in other words, you can
assign a variable to another variable. A simple example of this would be:
dim
x, y
as
byte
x =
5
' x is now 5
y = x
' y is now 5 as well
However, as covered above, there are several types of variables, and not all of
them can handle the same data. For example, what would happen if you assigned
a variable of type byte the value intended for a variable of type word?
Table below details all possible conversion situations.
C o n v e r t i n t o
54
55