Bt_ACompare() Function


<< Click to Display Table of Contents >>

Navigation:  Support Functions >


Bt_ACompare() Function


Previous pageReturn to chapter overviewNext page





Compare values in 2 arrays.







FUNCTION Bt_ACompare ( aValues AS ARRAY, aCrit AS ARRAY, nDirection AS LONG, aDesc AS ARRAY )  AS LOGIC







aValuesARRAY                (Field) values to check
aCritARRAY                (Scope) values to check against
nDirectionLONG                How to compare the values:
< 0                aValues must be Less or Equal to aCrit
> 0                aValues must be Greater or Equal to aCrit
= 0                aValues must be equal to aCrit
aDescARRAY                Array of flags that indicate whether to compare for Descending index                (True) or Ascending index (FALSE)








LOGIC        TRUE when the values match







This function is used internally (in the record movement methods) to check the current record against the active scope

The size of aCrit determines how many elements of the aValues array will be compared







aValues := SELF:OrderKeyValue(SELF:nOrder)

IF ! Bt_ACompare(aValues, oIndex:aScopeBot ,-1)

         // If not Current record <= Bottom Scope

         lOk := FALSE

         SELF:lEOF := TRUE