Section 7. Installation
132
with (x,y,z) being the indices, have (x • y • z) number of variables in a cubic x-by-
y-by-z matrix. Dimensions greater than three are not permitted by CRBasic.
When using variables in place of integers as dimension indices (see CRBasic
example
Using Variable Array Dimension Indices
(p. 132))
, declaring the indices
As
Long
variables is recommended. Doing so allows for more efficient use of
CR800 resources.
Using Variable Array Dimension Indices
'This program example demonstrates the use of dimension indices in arrays. The variable
'VariableName is declared with three dimensions with 4 in each index. This indicates the
'array has means it has 64 elements. Element 24 is loaded with the value 2.718.
'
Dim
aaa
As Long
Dim
bbb
As Long
Dim
ccc
As Long
Public
VariableName(4,4,4)
As Float
BeginProg
Scan
(1,sec,0,0)
aaa = 3
bbb = 2
ccc = 4
VariableName(aaa,bbb,ccc) = 2.718
NextScan
EndProg
7.6.3.3.3 Dimensioning String Variables
Strings can be declared to a maximum of two dimensions. The third "dimension"
is used for accessing characters within a string. See
String Operations
(p. 303).
String length can also be declared. See table
Data Types in Variable Memory.
(p.
A one-dimension string array called
StringVar
, with five elements in the array
and each element with a length of 36 characters, is declared as
Public
StringVar(5)
As String
* 36
Five variables are declared, each 36 characters long:
StringVar(1)
StringVar(2)
StringVar(3)
StringVar(4)
StringVar(5)
7.6.3.3.4 Declaring Flag Variables
A flag is a variable, usually declared
As Boolean
(p. 491),
that indicates True or
False, on or off, go or not go, etc. Program execution can be branched based on
the value in a flag. Sometime flags are simply used to inform an observer that an
event is occurring or has occurred. While any variable of any data type can be
used as a flag, using Boolean variables, especially variables named "Flag", usually
Содержание CR800 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 34: ......
Страница 54: ......
Страница 92: ......
Страница 190: ...Section 7 Installation 190 FIGURE 40 Running Average Frequency Response FIGURE 41 Running Average Signal Attenuation ...
Страница 310: ......
Страница 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Страница 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Страница 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Страница 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Страница 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Страница 456: ......
Страница 462: ......
Страница 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Страница 524: ......
Страница 526: ......
Страница 556: ......
Страница 558: ......
Страница 560: ......
Страница 597: ......