<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_SetScope |
Declare Function sx_SetScope Lib "Apollo9.dll"
(ByVal cpLowVal As Any,
ByVal cpHighVal As Any)
As Integer
Sets formal scope. The scope value is matched against the leftmost characters of the CURRENT index expression.
Pass all scope values as strings, even if the index is of type date or numeric. Date values must be passed in DTOS form (CCYYMMDD). Data conversion is done internally. Numbers are passed as string representations of the numbers. Logical key values are passed as 'T' or 'F'.
sx_QueryRecCount will return the number of records in scope. If sx_QueryRecCount is called when a scope is set, a query bitmap is constructed that is added to any existing query bitmaps. Clearing a scope does not clear a bitmap set with sx_Query, and vice versa.
cpLowVal: The low scope value. The first record with this key (or the immediately greater if this key does not exist) will become logical top of file.
Note: To clear a scope, pass cpLowVal as a NULL string (0&).
cpHighVal: The high scope value. If there is no high value, pass this parameter as a NULL string (0&).
If cpHighVal is passed as a NULL string (0&), the scope is evaluated as follows:
sx_IndexKeyField = cpLowVal
If cpHighVal is passed as a non-NULL string, it must be greater than or equal to cpLowVal. If cpHighVal exists, the scope is evaluated as:
sx_IndexKeyField >= sLowVal .and. sx_IndexKeyField <= sHighVal
The last record with a key less than or equal to cpHighVal becomes logical bottom of file.
True if scope set successfully and False if not.
' Set scope to view records between Jones and Smith only
sx_SetOrder( sx_TagArea( "LASTNAME" ))
iRetVal = sx_SetScope( "Jones", "Smith" )