%StructCalcOp function
Related pages:
%StructCalcOp( in _recA[fromRowA]^fromColA, IN _recA[toRowA]^toColA, in _recB[fromRowB]^fromColB, in _recC[fromRowC]^fromColC, INT in _operation [, IN BOOL _bInvalidIsZero = @TRUE], )
_recA[fromRowA]^fromColA, _recA[toRowA]^toColA | Reference to the value of local structured variable field. |
_recB[fromRowB]^fromColB | Reference to the value of local structured variable field. |
_recC[fromRowC]^fromColC | Reference to the value of local structured variable field. |
INT IN _operation | Type of performed mathematical operation. |
IN BOOL _bInvalidIsZero | Optional parameter. Determines a behavior of mathematical operation in case that some of operands has an invalid value. |
Value | Mathematical operation |
0 | + |
1 | - |
2 | * |
3 | / |
where:
Symbol A represents an area of local structured variable values which is given by its left upper corner (field _recA[fromRowA]^fromColA) and right lower corner (field _recA[toRowA]^toColA). The structured variable which is used in the first and second parameter must be the same. The dimensions (number of rows and columns) are also defined by this way. They are used in the definition of B and C areas that are defined only by their right upper corner in the parameters.
The mathematical operation (defined by a parameter) is performed among the individual appropriate fields of A and B areas. A result is written into the C area.
A set parameter _bInvalidIsZero (zeroing of invalid value) is interpreted as follows:
BEGIN RECORD (SD.BIG) _A RECORD (SD.BIG) _B RECORD (SD.BIG) _C REDIM _A[20] REDIM _B[20] REDIM _C[20] INT _firstColNr, _lastColNr _firstColNr := 1 _lastColNr := _A\CNR _A[1]^R1 := 1 _A[2]^R1 := 2 _B[1]^R1 := 1 _B[2]^R1 := 2 %StructCalcOp(_A[1]^_firstColNr,_A[2]^_lastColNr,_B[1]^_firstColNr,_C[1]^_firstColNr,0) END
Related pages:
Pridať komentár