home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / forthmac / !Forthmacs / docs / ascii / terminal < prev    next >
Encoding:
Text File  |  1997-05-01  |  2.4 KB  |  93 lines

  1.  
  2. Terminal Control
  3. ****************
  4.  
  5. This chapter lists the words for performing terminal operations such as moving 
  6. the cursor, inserting or deleting lines, etc.  When writing programs you are 
  7. advised to use only these user interface words.  
  8.  
  9.  
  10. User interface words
  11. ====================
  12.  
  13. left moves the cursor one character to the left 
  14.  
  15. right Moves the cursor one character to the right 
  16.  
  17. up moves the cursor one line up 
  18.  
  19. down moves the cursor one line down 
  20.  
  21. kill-line erases from the cursor to the end of the line 
  22.  
  23. kill-screen erases from the cursor to the end of the screen 
  24.  
  25. insert-line inserts a blank line at the cursor position 
  26.  
  27. delete-line deletes the line the cursor is on 
  28.  
  29. erase-screen erases the entire screen 
  30.  
  31. beep rings the bell 
  32.  
  33. dark switches to inverse video 
  34.  
  35. light switches to normal video 
  36.  
  37. at-xy moves the cursor to a specified column and line 
  38.  
  39. at-xy? gets the current output-cursor position 
  40.  
  41. set-cursor-status 
  42.  
  43. get-cursor-status 
  44.  
  45. #lines returns the number of lines on the screen 
  46.  
  47. #columns returns the number of columns on the screen 
  48.  
  49. cursor-off 
  50.  
  51. cursor-on 
  52.  
  53. marked switches to 'marked' output i.e.  red-on-white by default.  
  54.  
  55.  
  56. Terminals
  57. =========
  58.  
  59. All user interface terminal words are deferred via the terminal: definition 
  60. itself.  This allowes support for lots of different output devices, serial 
  61. interfaces, WIMP environment, text windows, VT220 devices can all be supported 
  62. and are very easy to switch between.  
  63.  
  64. Just have a look at the defining of a WISE terminal 'extend.terminal.wyse' : 
  65.  
  66.     only forth also terminals definitions
  67.     terminal: wyse
  68.     prototype dumb
  69.     for (right         ctl F ;
  70.     for (at-xy         esc Y   bl + (emit  bl + (emit  ;
  71.     for (insert-char   esc q    (emit  esc r  ;
  72.     for (delete-char   esc W ;
  73.     for (kill-line     esc K ;
  74.     for (kill-screen   esc k ;
  75.     for (insert-line   esc M ;
  76.     for (delete-line   esc l ;
  77.     for (erase-screen  ctl L ;
  78.     for dark           ctl N ;
  79.     for light          ctl O ;
  80.     : wyse-vp  wyse ;  : wv wyse ;
  81.     only forth also terminals also forth definitions
  82.     : wyse wyse ;
  83.     only forth also definitions
  84.  
  85. After this you only have to call 
  86.     wise
  87. and all the user interface words all call the wyse functions.  
  88.  
  89. NOTE: The terminal: will later also include the windowing functions.  All 
  90. existing software should also run in the WIMP environment, the new functions 
  91. won't be used in the text environment.  
  92.  
  93.