FGETS( ) Function Example

*** TEST.TXT must exist ***
STORE FOPEN('test.txt') TO gnFileHandle    && Open the file
STORE FSEEK(gnFileHandle, 0, 2) TO gnEnd    && Move pointer to EOF
STORE FSEEK(gnFileHandle, 0) TO gnTop     && Move pointer to BOF
IF gnEnd <= 0  && Is file empty?
   WAIT WINDOW 'This file is empty!' NOWAIT
ELSE  && If not
   gcString = FGETS(gnFileHandle, gnEnd)  && Store contents
   ? gcString
ENDIF
= FCLOSE(gnFileHandle)  && Close the file