%StructCmp function
Related pages:
BOOL %StructCmp( in _recA[fromRowA]^fromColA, IN _recA[toRowA]^toColA, in _recB[fromRowB]^fromColB, INT in _cmpOptions [,INT in _roundPrec] )
_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. |
_cmpOptions | Way of comparison. |
_roundPrec | Optional parameter. It specifies how many decimal places the compared values (they must be of the Real type) are rounded to. The value must be >= 0. |
Value | Compare the part of value |
1 | value |
2 | time of value formation |
4 | users flags |
The comparison is done as follows:
A=B
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 definition of B area that is defined only by its right upper corner in the parameters.
The comparison is done among the individual appropriate fields of A and B areas. The function gets back the value @TRUE if all fields, that are compared, accomplish a condition of equality.
BEGIN BOOL _bEqual RECORD (SD.BIG) _A RECORD (SD.BIG) _B REDIM _A[20] REDIM _B[20] INT _firstColNr, _lastColNr _firstColNr := 1 _lastColNr := _A\CNR _A[1]^R1 := 1 _A[2]^R1 := 2 DELAY 1[s] _B[1]^R1 := 1 _B[2]^R1 := 2 _bEqual := %StructCmp(_A[1]^_firstColNr,_A[2]^_lastColNr,_B[1]^_firstColNr,1) ;result is @TRUE _bEqual := %StructCmp(_A[1]^_firstColNr,_A[2]^_lastColNr,_B[1]^_firstColNr,2) ;result is @FALSE, because the time of values are different END
Related pages:
Pridať komentár