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

  1. <!-- Forthmacs Formatter generated HTML V.2 output -->
  2. <html>
  3. <head>
  4. <title>Terminal Control</title>
  5. </head>
  6. <body>
  7. <h1>Terminal Control</h1>
  8. <hr>
  9. <p>
  10. This chapter lists the words for performing terminal operations such as moving 
  11. the cursor, inserting or deleting lines, etc.  When writing programs you are 
  12. advised to use only these user interface words.  
  13. <p>
  14. <p>
  15. <h2>User interface words</h2>
  16. <p>
  17. <code><A href="_smal_AF#245">left</A></code> moves the cursor one character to 
  18. the left 
  19. <p>
  20. <code><A href="_smal_AP#2AF">right</A></code> Moves the cursor one character to 
  21. the right 
  22. <p>
  23. <code><A href="_smal_BD#31B">up</A></code> moves the cursor one line up 
  24. <p>
  25. <code><A href="_smal_BD#1CB">down</A></code> moves the cursor one line down 
  26. <p>
  27. <code><A href="_smal_BV#23D">kill-line</A></code> erases from the cursor to the 
  28. end of the line 
  29. <p>
  30. <code><A href="_smal_BW#23E">kill-screen</A></code> erases from the cursor to 
  31. the end of the screen 
  32. <p>
  33. <code><A href="_smal_BF#22D">insert-line</A></code> inserts a blank line at the 
  34. cursor position 
  35. <p>
  36. <code><A href="_smal_AH#1B7">delete-line</A></code> deletes the line the cursor 
  37. is on 
  38. <p>
  39. <code><A href="_smal_AF#1E5">erase-screen</A></code> erases the entire screen 
  40. <p>
  41. <code><A href="_smal_AE#154">beep</A></code> rings the bell 
  42. <p>
  43. <code><A href="_smal_BU#1AC">dark</A></code> switches to inverse video 
  44. <p>
  45. <code><A href="_smal_AG#246">light</A></code> switches to normal video 
  46. <p>
  47. <code><A href="_smal_BX#14F">at-xy</A></code> moves the cursor to a specified 
  48. column and line 
  49. <p>
  50. <code><A href="_smal_AA#150">at-xy?</A></code> gets the current output-cursor 
  51. position 
  52. <p>
  53. <code><A href="_smal_BS#2CA">set-cursor-status</A></code> 
  54. <p>
  55. <code><A href="_smal_AI#218">get-cursor-status</A></code> 
  56. <p>
  57. <code><A href="_smal_BD#7B">#lines</A></code> returns the number of lines on the 
  58. screen 
  59. <p>
  60. <code><A href="_smal_AX#77">#columns</A></code> returns the number of columns on 
  61. the screen 
  62. <p>
  63. <code><A href="_smal_BH#19F">cursor-off</A></code> 
  64. <p>
  65. <code><A href="_smal_BI#1A0">cursor-on</A></code> 
  66. <p>
  67. <code><A href="_smal_BM#264">marked</A></code> switches to 'marked' output i.e.  
  68. red-on-white by default.  
  69. <p>
  70. <p>
  71. <h2>Terminals</h2>
  72. <p>
  73. All user interface terminal words are deferred via the <code><A href="_smal_BJ#2F1">terminal:</A></code> 
  74. definition itself.  This allowes support for lots of different output devices, 
  75. serial interfaces, WIMP environment, text windows, VT220 devices can all be 
  76. supported and are very easy to switch between.  
  77. <p>
  78. Just have a look at the defining of a WISE terminal <em>extend.terminal.wyse</em> 
  79. <p>
  80. <p><pre>
  81.     only forth also terminals definitions
  82.     terminal: wyse
  83.     prototype dumb
  84.     for (right         ctl F ;
  85.     for (at-xy         esc Y   bl + (emit  bl + (emit  ;
  86.     for (insert-char   esc q    (emit  esc r  ;
  87.     for (delete-char   esc W ;
  88.     for (kill-line     esc K ;
  89.     for (kill-screen   esc k ;
  90.     for (insert-line   esc M ;
  91.     for (delete-line   esc l ;
  92.     for (erase-screen  ctl L ;
  93.     for dark           ctl N ;
  94.     for light          ctl O ;
  95.     : wyse-vp  wyse ;  : wv wyse ;
  96.     only forth also terminals also forth definitions
  97.     : wyse wyse ;
  98.     only forth also definitions
  99. </pre><p>
  100. <p>
  101. After this you only have to call 
  102. <p><pre>  wise</pre><p>
  103. and all the user interface words all call the wyse functions.  
  104. <p>
  105. NOTE: The <code><A href="_smal_BJ#2F1">terminal:</A></code> will later also 
  106. include the windowing functions.  All existing software should also run in the 
  107. WIMP environment, the new functions won't be used in the text environment.  
  108. <p>
  109. </body>
  110. </html>
  111.