home *** CD-ROM | disk | FTP | other *** search
-
- Terminal Control
- ****************
-
- 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.
-
-
- User interface words
- ====================
-
- left moves the cursor one character to the left
-
- right Moves the cursor one character to the right
-
- up moves the cursor one line up
-
- down moves the cursor one line down
-
- kill-line erases from the cursor to the end of the line
-
- kill-screen erases from the cursor to the end of the screen
-
- insert-line inserts a blank line at the cursor position
-
- delete-line deletes the line the cursor is on
-
- erase-screen erases the entire screen
-
- beep rings the bell
-
- dark switches to inverse video
-
- light switches to normal video
-
- at-xy moves the cursor to a specified column and line
-
- at-xy? gets the current output-cursor position
-
- set-cursor-status
-
- get-cursor-status
-
- #lines returns the number of lines on the screen
-
- #columns returns the number of columns on the screen
-
- cursor-off
-
- cursor-on
-
- marked switches to 'marked' output i.e. red-on-white by default.
-
-
- Terminals
- =========
-
- All user interface terminal words are deferred via the terminal: 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.
-
- Just have a look at the defining of a WISE terminal 'extend.terminal.wyse' :
-
- 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
-
- After this you only have to call
- wise
- and all the user interface words all call the wyse functions.
-
- NOTE: The terminal: 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.
-
-