home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / sedapnd.seq < prev    next >
Text File  |  1989-07-06  |  1KB  |  40 lines

  1. \ SEDAPND.SEQ   Append text to TEMP.SEQ or user specified file.
  2.  
  3. editor definitions
  4.  
  5. headerless
  6.  
  7. : append        ( --- )
  8.                 marking 0=
  9.                 if      .nomark exit
  10.                 then    "  Append marked text to filename: " ">$ =: export$
  11.                 savescr
  12.                 ?getexpfile ?exit
  13.                 ."  Appending text to " ed2hndl count type ." ..." >norm
  14.                 sdln                            \ move down a line in file
  15.                 read-write                      \ open for append
  16.                 ed2hndl hopen                   \ open if possible
  17.                 if      ed2hndl hcreate 0=      \ or make if needed
  18.                 else    true
  19.                 then
  20.                 if      ed2hndl endfile 2drop
  21.                         off> wblen
  22.                         markend 1+ markstrt
  23.                         do      i linewrite ?leave
  24.                         loop    flushwrite      ( --- f1 )
  25.                         if      ." Failed, Disk FULL " beep 2 seconds
  26.                         then    ed2hndl hclose
  27.                         " \4 Error Closing File " ?softerror
  28.                         mark-clear
  29.                 else    true
  30.                         " \4 Failed, Couldn't OPEN or CREATE file "
  31.                         ?softerror
  32.                 then    restscr scrshow suln ;
  33.  
  34. ' append is appendx     \ patch function into SED
  35.  
  36. headers
  37.  
  38. forth definitions
  39.  
  40.