46
Programming with TIDE
©2000-2008 Tibbo Technology Inc.
C
o
n
v
e
r
t
f
r
o
m
Byte
Word
Dwor
d
Char
Short
Lon
g
Re
al
Stri
ng
Byt
e
---
OK
OK
Reinter
pret
OK
OK
OK
OK
Wo
rd
Trun
cate
---
OK
Reinter
pret
Trunca
te
Reinte
rpret
OK
OK
OK
Dw
ord
Trun
cate
Trunc
ate
---
Trunca
te
Trunc
ate
Reint
erpr
et
OK
OK
Ch
ar
Reint
erpre
t
Reinte
rpret
Reinte
rpret
---
OK
OK
OK
OK
Sh
ort
Reint
erpre
t
Trun
cate
Reinte
rpret
Reinte
rpret
Trunca
te
---
OK
OK
OK
Lon
g
Reint
erpre
t
Trun
cate
Reinte
rpret
Trunca
te
Trunca
te
Trunc
ate
---
OK
OK
Re
al
Fract
ion
???
Fracti
on
???
Fractio
n
???
Fractio
n
???
Fracti
on
???
Fract
ion
????
---
OK
fstr*
Stri
ng
OK
OK
OK
OK
OK
OK
OK
---
*fstr is a functional equivalent of
, but without mode and rnd parameters.
Conversions without loss
Conversions marked as "
OK
" incur no loss -- the value being passed from variable
of one type to variable of another type remains unchanged. For example,
conversion from word into dword is done without any loss, because 32-bit word
variable can hold any value that the 16-bit word variable can hold.
Conversions that cause reinterpretation
Conversions marked with "
Reinterpret
" mean that although binary data held by the
receiving variable may be the same this binary variable may be interpreted
differently on the destination "side". As an example, see this conversion from byte
into char:
dim
x
as
byte
dim
c
as
char
x =
254
c = x
' c now contains the binary value of 254, which is interpreted as -2
207
207
199
208
208
200
210
210
200
210
210
200
209
194