Section 7. Installation
144
When a Function() function returns a pointer, apply the ! operator to the function
call, as shown in the following example:
Function
ConstrainFunc(Value As Long,Low As Long,High As Long)
As Long
If
!Value < !Low
Then
Return
Low
ElseIf
!Value > !High
Then
Return
High
Else
Return
Value
EndIf
EndFunction
‘Call within program
FuncFltRes = !ConstrainFunc(@FltVal,@FltLow,@FltHigh)
7.6.3.5 Declaring Arrays
Related Topics:
• Declaring Arrays
(p. 144)
• VarOutOfBounds
(p. 513)
Multiple variables of the same root name can be declared. The resulting series of
like-named variables is called an array. An array is created by placing a suffix of
(x) on the variable name. X number of variables are created that differ in name
only by the incrementing number in the suffix. For example, the four statements
Public
TempC1
Public
TempC2
Public
TempC3
Public
TempC4
can simply be condensed to
Public
TempC(4).
This statement creates in memory the four variables TempC(1), TempC(2),
TempC(3), and TempC(4).
A variable array is useful in program operations that affect many variables in the
same way. CRBasic example Using a Variable Array in Calculations
(p. 145)
shows compact code that converts four temperatures (°C) to °F.
In this example, a For/Next structure with an incrementing variable is used to
specify which elements of the array will have the logical operation applied to
them. The CRBasic For/Next function will only operate on array elements that
are clearly specified and ignore the rest. If an array element is not specifically
referenced, as is the case in the declaration
Dim TempC()
CRBasic references only the first element of the array, TempC(1).
See CRBasic example Concatenation of Numbers and Strings
(p. 329)
for an
example of using the += assignment operator when working with arrays.
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......