home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / editerr.seq < prev    next >
Text File  |  1990-11-12  |  1KB  |  32 lines

  1. \ EDITERR.SEQ   Automatically enter editor on compile error
  2.  
  3. defined ed nip 0= #if \s  #endif        \ if ED not defined, stop loading
  4.  
  5. only forth also definitions editor also
  6.  
  7. create msgsave  32 allot
  8. create wordsave 32 allot
  9.  
  10. : (EDITERR)     ( a1 n1 --- )
  11.                 31 min dup msgsave c! msgsave 1+ swap cmove
  12.                 >in @ 1- here c@ - 0MAX =: screenchar
  13.                 tib screenchar + wordsave dup>r 1+
  14.                 here c@ 31 min dup>r cmove r> r> c!
  15.                 0 rows 1- at
  16.                 30 here c@ msgsave c@ + 2/ - spaces ." █████>  "
  17.                 wordsave count type 2 spaces
  18.                 msgsave count type ."   <█████  "
  19.                 edinit
  20.                 rows 3 - save!> last.textline
  21.                 ?leave_set
  22.                 <ed>
  23.                 restore> last.textline
  24.                 done quit    ;
  25.  
  26. : autoediton    ( --- )
  27.                 ['] (editerr) is doerror ;
  28.  
  29. : autoeditoff   ( --- )
  30.                 ['] (doerror) is doerror ;
  31.  
  32.