SETLEFT, SETRIGHT |
![]() ![]() ![]() |
The SETLEFT and SETRIGHT statements set the scanning position of an alternate key index at the extreme left or right of the data.
Format
SETLEFT index.name FROM file.var SETRIGHT index.name FROM file.var
where
The SETLEFT and SETRIGHT statements are used with SELECTLEFT and SELECTRIGHT to set the scan position to the first or last entry in an alternate key index.
The STATUS() function returns zero if the operation is successful, non-zero if it fails because the index does not exist.
Example
SETLEFT 'POSTCODE' FROM CLIENTS.FILE LOOP SELECTRIGHT 'POSTCODE' FROM CLIENT.FILE SETTING POSTCODE UNTIL POSTCODE[1,1] >= 'N' CRT POSTCODE REPEAT
This program displays a list of all postcodes commencing with a letter in the first half of the alphabet.
See also: |