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

  1. ********************
  2.  
  3. FUNCTION Readdate
  4.  
  5.    PARAMETERS _file
  6.  
  7.    * take the _file and the _date and write the _date
  8.    * to the back end of the _file, makring the file with
  9.    * the _date and a special code: ddddddddxxxxxSJSD
  10.  
  11.    IF PCOUNT() != 1
  12.       RETURN(.F.)
  13.    ELSEIF TYPE("_file") != "C"
  14.       RETURN(.F.)
  15.    ELSEIF !FILE(_file)
  16.       RETURN(.F.)
  17.    ENDIF
  18.  
  19.    PRIVATE _fhandle, _date, _temp
  20.  
  21.    _fhandle = FOPEN(_file, 2)
  22.  
  23.    FSEEK(_fhandle, -6, 2)
  24.  
  25.    _temp = FREADSTR(_fhandle, 4)
  26.  
  27.    IF _temp != "SJSD"
  28.       && we have an error
  29.       RETURN(CTOD("  /  /  ")) 
  30.    ENDIF
  31.    FSEEK(_fhandle, -4,  1)       && To get back to the original position
  32.    FSEEK(_fhandle, -10, 1)      && Ignor the lenght: I know it
  33.    FSEEK(_fhandle, -8,  1)
  34.    _date = CTOD(FREADSTR(_fhandle, 8))
  35.    FCLOSE(_fhandle)
  36.    RETURN(_date)
  37.  
  38. * End of File
  39.  
  40.  
  41.