Section 7. Installation
CRBasic Example 16.
Use of Move() to Conserve Code Space
Move
(counter(1),6,0,1)
'Reset six counters to zero. Keep array
'filled with the ten most current readings
Move
(TempC(2),9,TempC(1),9)
'Shift previous nine readings to make room
'for new measurement
'New measurement:
TCDiff
(TempC(1),1,mV2_5C,8,TypeT,PTemp,True,0,_60Hz,1.0,0)
CRBasic Example 17.
Use of Variable Arrays to Conserve Code Space
For
I = 1
to
20
TCTemp(I) = TCTemp(I) * 1.8 + 32
Next
I
7.8.4.15.3 Expressions with Numeric Data Types
FLOAT
s,
LONG
s and
Boolean
s are cross-converted to other data types, such as
FP2
, by using
'='
.
Boolean from FLOAT or LONG
When a
FLOAT
or
LONG
is converted to a
Boolean
as shown in CRBasic
example
Conversion of FLOAT / LONG to Boolean
(p. 162),
zero becomes false (
0
)
and non-zero becomes true (
-1
).
CRBasic Example 18.
Conversion of FLOAT / LONG to Boolean
'This program example demonstrates conversion of Float and Long data types to Boolean
'data type.
Public
Fa
As Float
Public
Fb
As Float
Public
L
As Long
Public
Ba
As Boolean
Public
Bb
As Boolean
Public
Bc
As Boolean
BeginProg
Fa = 0
Fb = 0.125
L = 126
Ba = Fa
'This will set Ba = False (0)
Bb = Fb
'This will Set Bb = True (-1)
Bc = L
'This will Set Bc = True (-1)
EndProg
FLOAT from LONG or Boolean
When a
LONG
or
Boolean
is converted to
FLOAT
, the integer value is loaded
into the
FLOAT
. Booleans are converted to
-1
or
0
.
LONG
integers greater than
24 bits (16,777,215; the size of the mantissa for a
FLOAT
) will lose resolution
when converted to
FLOAT
.
LONG from FLOAT or Boolean
When converted to
Long, Boolean
is converted to
-1
or
0
. When a
FLOAT
is
162
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......