In the following example, GETEXPR is used to get a LOCATE expression of the proper type. If LOCATE is successful, the company name is displayed; otherwise, a message is displayed.
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer && Opens Customer table
GETEXPR 'Enter condition to locate ' TO gcTemp;
TYPE 'L' DEFAULT 'COMPANY = ""'
LOCATE FOR &gcTemp
IF FOUND( )
DISPLAY
ELSE
? 'Condition ' + gcTemp + ' was not found '
ENDIF