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

  1. ********************
  2.  
  3. FUNCTION Writedate
  4.  
  5.    PARAMETERS _file, _date
  6.  
  7.    * take the _file and the _date and write the _date
  8.    * to the back end of the _file, marking the file with
  9.    * the _date and a special code: ddddddddxxxxxSJSD
  10.  
  11.    IF PCOUNT() != 2
  12.       RETURN(.F.)
  13.    ENDIF
  14.  
  15.    IF TYPE("_file") + TYPE("_date") != "CD"
  16.       RETURN(.F.)
  17.    ENDIF
  18.  
  19.    PRIVATE _temp, _length, _fhandle, _string
  20.  
  21.    _temp = DTOC(_date)
  22.    _length = 8
  23.    
  24.    _fhandle = FOPEN(_file, 2)
  25.  
  26.    FSEEK(_fhandle, FSEEK(_fhandle, 0, 2))  && Move to the end of file
  27.  
  28.    _string = TRIM(I2BIN(26) + _temp + TRANSFORM(_length, "9999999999") + "SJSD" + I2BIN(26))
  29.  
  30.    FWRITE(_fhandle, _string )
  31.  
  32.    FCLOSE(_fhandle)
  33.    RETURN( (FERROR() = 0) )
  34.  
  35. * End of File
  36.  
  37.