home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST251.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  802 b   |  35 lines

  1. *******************
  2.  
  3. FUNCTION Readchar
  4.  
  5.    PARAMETERS _file
  6.  
  7.    IF PCOUNT() != 1
  8.       RETURN(.F.)
  9.    ELSEIF TYPE("_file") != "C"
  10.       RETURN(.F.)
  11.    ELSEIF !FILE(_file)
  12.       RETURN(.F.)
  13.    ENDIF
  14.  
  15.    PRIVATE _fhandle, _temp, _length
  16.  
  17.    _fhandle = FOPEN(_file, 2)
  18.  
  19.    FSEEK(_fhandle, -6, 2)
  20.    _temp = FREADSTR(_fhandle, 4)
  21.    IF _temp != "SJSC"
  22.       RETURN("")
  23.    ENDIF
  24.    FSEEK(_fhandle, -4,  1)  && To get back to the original position
  25.    FSEEK(_fhandle, -10, 1)  && Get the length of the character string to read
  26.    _length = VAL(FREADSTR(_fhandle, 10))
  27.    FSEEK(_fhandle, -10, 1)  && Get the length of the character string to read
  28.    FSEEK(_fhandle, _length * -1, 1)
  29.    _temp = FREADSTR(_fhandle, _length)
  30.    FCLOSE(_fhandle)
  31.    RETURN(_temp)
  32.  
  33. * End of File
  34.  
  35.