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

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