home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / sscroll.seq < prev    next >
Text File  |  1988-11-30  |  1KB  |  35 lines

  1. \ SSCROLL.SEQ           Sample sub screen scrolling     by Tom Zimmer
  2.  
  3. comment:
  4.  
  5.   This file contains an example of how to make the screen scroll only a
  6. limited set of lines.  the file contains three user words as follows:
  7.  
  8.         SUB-SET ( n1 --- )      \ set the line where scrolling starts
  9.         SUB-ON                  \ start sub screen scrolling
  10.         SUB-OFF                 \ stop sub screen scrolling
  11.  
  12. comment;
  13.  
  14. 0 value sub-line
  15.  
  16. : sub-scroll    ( --- )         \ scroll only a portion of the screen
  17.                 #line @ sub-line <
  18.         if      crlf
  19.                                         \ scroll only a portion
  20.         else    0 sub-line 1 max rows 1- min at -line
  21.                 0 rows 1- at            \ move to last line of screen
  22.         then    ;
  23.  
  24. \ ******************* User words start here *******************
  25.  
  26. : sub-set       ( n1 --- )      \ set the starting sub screen scroll line
  27.                 1 max 23 min !> sub-line ;
  28.  
  29. : sub-on        ( --- )         \ Turn on sub screen scrolling
  30.                 ['] sub-scroll is cr ;
  31.  
  32. : sub-off       ( --- )         \ Turn off sub screen scrolling
  33.                 ['] crlf is cr ;
  34.  
  35.