Specifications
Section 8. Processing and Math Instructions
8-20
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, DestReps, Source, SourceReps)
Moves a block or fills an array.
Syntax
Move(Dest, DestReps, Source, SourceReps)
Remarks
Block Move or fill array.
Parameter
& Data Type
Enter
Dest
Variable or
Array
The first variable of an array in which to store the variables being moved.
DestReps
Constant
The number of elements in the destination array to fill.
Source
Array or
Expression
The name of the variable array or expression that is the source of the values
to move.
SourceReps
Constant
The SourceReps parameter is the number of variables that should be moved
into the Dest array. This parameter should be set equal to the DestReps
parameter, or, as a special case, set to 1. If this parameter is set to 1, the
same value will be placed in each variable of the Dest array. If SourceReps
is less than DestReps, the remainder of the Dest array is filled with the last
value from Source.