
Section 8. Processing and Math Instructions
Parameter
& Data Type
Enter
Dest
Variable
The variable in which to store the results of the instruction.
Swath
Constant
The number of values of the source array in which to search of the
minimum.
Source
Array
The name of the variable array that is the input for the instruction.
MinSpa Function Example
This example uses MinSpa to find the minimum value of the five elements
Temp(6) through Temp(10) and store the result in the variable MinTemp.
MinSpa(MinTemp, 5, Temp(6))
Mod
Divides two numbers and returns only the remainder.
Syntax
result = operand1 Mod operand2
Remarks
The modulus, or remainder, operator divides operand1 by operand2 (rounding
floating-point numbers to integers) and returns only the remainder as result.
For example, in the expression A = 19 Mod 6.7, A (which is result) equals
5.6. The operands can be any numeric expression.
Mod Operator Example
The example uses the Mod operator to determine if a 4-digit year is a leap
year.
Dim TestYr, LeapStatus 'Declare variables.
TestYr = 1995
If TestYr Mod 4 = 0 And TestYr Mod 100 = 0 Then 'Divisible by 4?
If TestYr Mod 400 = 0 Then 'Divisible by 400?
LeapStatus = True
Else
LeapStatus = False
End If
ElseIf TestYr Mod 4 = 0 Then
LeapStatus = True
Else
LeapStatus = False
End If
Move (Dest, Reps, Source, Reps)
Moves a block or fills an array.
Syntax
Move(Dest, Reps, Source, Reps)
Remarks
Block Move or fill array.
8-19
Comentarios a estos manuales