IF ... ENDIF Command Example

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE Customer     && Open customer table

GETEXPR 'Enter condition to locate ' TO gcTemp;
   TYPE 'L' DEFAULT 'COMPANY = ""'
LOCATE FOR &gcTemp  && Enter LOCATE expression
IF FOUND( )  && Was it found?
   DISPLAY  && If so, display the record
ELSE  && If not found
   ? 'Condition ' + gcTemp + ' was not found '   && Display a message
ENDIF
USE