home *** CD-ROM | disk | FTP | other *** search
- <!-- Forthmacs Formatter generated HTML V.2 output -->
- <html>
- <head>
- <title>Terminal Control</title>
- </head>
- <body>
- <h1>Terminal Control</h1>
- <hr>
- <p>
- This chapter lists the words for performing terminal operations such as moving
- the cursor, inserting or deleting lines, etc. When writing programs you are
- advised to use only these user interface words.
- <p>
- <p>
- <h2>User interface words</h2>
- <p>
- <code><A href="_smal_AF#245">left</A></code> moves the cursor one character to
- the left
- <p>
- <code><A href="_smal_AP#2AF">right</A></code> Moves the cursor one character to
- the right
- <p>
- <code><A href="_smal_BD#31B">up</A></code> moves the cursor one line up
- <p>
- <code><A href="_smal_BD#1CB">down</A></code> moves the cursor one line down
- <p>
- <code><A href="_smal_BV#23D">kill-line</A></code> erases from the cursor to the
- end of the line
- <p>
- <code><A href="_smal_BW#23E">kill-screen</A></code> erases from the cursor to
- the end of the screen
- <p>
- <code><A href="_smal_BF#22D">insert-line</A></code> inserts a blank line at the
- cursor position
- <p>
- <code><A href="_smal_AH#1B7">delete-line</A></code> deletes the line the cursor
- is on
- <p>
- <code><A href="_smal_AF#1E5">erase-screen</A></code> erases the entire screen
- <p>
- <code><A href="_smal_AE#154">beep</A></code> rings the bell
- <p>
- <code><A href="_smal_BU#1AC">dark</A></code> switches to inverse video
- <p>
- <code><A href="_smal_AG#246">light</A></code> switches to normal video
- <p>
- <code><A href="_smal_BX#14F">at-xy</A></code> moves the cursor to a specified
- column and line
- <p>
- <code><A href="_smal_AA#150">at-xy?</A></code> gets the current output-cursor
- position
- <p>
- <code><A href="_smal_BS#2CA">set-cursor-status</A></code>
- <p>
- <code><A href="_smal_AI#218">get-cursor-status</A></code>
- <p>
- <code><A href="_smal_BD#7B">#lines</A></code> returns the number of lines on the
- screen
- <p>
- <code><A href="_smal_AX#77">#columns</A></code> returns the number of columns on
- the screen
- <p>
- <code><A href="_smal_BH#19F">cursor-off</A></code>
- <p>
- <code><A href="_smal_BI#1A0">cursor-on</A></code>
- <p>
- <code><A href="_smal_BM#264">marked</A></code> switches to 'marked' output i.e.
- red-on-white by default.
- <p>
- <p>
- <h2>Terminals</h2>
- <p>
- All user interface terminal words are deferred via the <code><A href="_smal_BJ#2F1">terminal:</A></code>
- definition itself. This allowes support for lots of different output devices,
- serial interfaces, WIMP environment, text windows, VT220 devices can all be
- supported and are very easy to switch between.
- <p>
- Just have a look at the defining of a WISE terminal <em>extend.terminal.wyse</em>
- :
- <p>
- <p><pre>
- only forth also terminals definitions
- terminal: wyse
- prototype dumb
- for (right ctl F ;
- for (at-xy esc Y bl + (emit bl + (emit ;
- for (insert-char esc q (emit esc r ;
- for (delete-char esc W ;
- for (kill-line esc K ;
- for (kill-screen esc k ;
- for (insert-line esc M ;
- for (delete-line esc l ;
- for (erase-screen ctl L ;
- for dark ctl N ;
- for light ctl O ;
- : wyse-vp wyse ; : wv wyse ;
- only forth also terminals also forth definitions
- : wyse wyse ;
- only forth also definitions
- </pre><p>
- <p>
- After this you only have to call
- <p><pre> wise</pre><p>
- and all the user interface words all call the wyse functions.
- <p>
- NOTE: The <code><A href="_smal_BJ#2F1">terminal:</A></code> will later also
- include the windowing functions. All existing software should also run in the
- WIMP environment, the new functions won't be used in the text environment.
- <p>
- </body>
- </html>
-