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.
Содержание CR3000 Micrologger
Страница 2: ......
Страница 3: ......
Страница 4: ......
Страница 6: ......
Страница 30: ......
Страница 34: ......
Страница 36: ......
Страница 96: ......
Страница 200: ...Section 7 Installation 200 FIGURE 42 Running Average Frequency Response FIGURE 43 Running Average Signal Attenuation ...
Страница 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Страница 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Страница 488: ...Section 8 Operation 488 8 11 2 3 Final Storage Data FIGURE 113 Keyboard and Display Final Storage Data ...
Страница 489: ...Section 8 Operation 489 8 11 3 Run Stop Program FIGURE 114 Keyboard and Display Run Stop Program ...
Страница 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Страница 495: ...Section 8 Operation 495 Low power standby whenever possible Low power bus sets bus and modules to low power ...
Страница 496: ......
Страница 502: ......
Страница 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Страница 566: ......
Страница 594: ......
Страница 598: ......
Страница 600: ......
Страница 602: ......
Страница 624: ......
Страница 642: ......
Страница 643: ......