*---------------------------------------------------------------------* * file2str - takes a file and returns it contents back * *---------------------------------------------------------------------* FUNCTION FILE2STR PARAMETER pc_file PRIVATE ln_hndl, ln_size, lc_string STORE 0 TO ln_hndl, ln_size lc_string = SPACE(0) IF TYPE('pc_file') = "C" .AND. FILE(pc_file) ln_hndl = FOPEN(pc_file) *-- Move to the bottom of the file ln_size = FSEEK(ln_hndl, 0, 2) *-- Move to the top =FSEEK(ln_hndl, 0, 0) lc_string = FREAD(ln_hndl, ln_size) =FCLOSE(ln_hndl) ENDIF RETURN (lc_string)