home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
200-299
/
ff239.lzh
/
JGoodies
/
Brunjes
/
CursorControl
< prev
next >
Wrap
Text File
|
1989-08-21
|
2KB
|
61 lines
\
\ Elementary cursor control words.
\
\ Author: Roy E. Brunjes 20 August 1988
\
ANEW Cursor.Words
Base @ \ Save current base on stack
HEX \ The radix of choice for this type of work
9B CONSTANT <CSI> \ The "Control Sequence Introducer"
: ## ( n -- addr cnt ) \ Convert n to an ASCII string of 2 chars
S->D \ The #-based formatting words use d's
<# # # #> ;
: Cursor.XY ( row column -- ) \ Send cursor to (X=row, Y=column)
<CSI> EMIT
SWAP
## TYPE
3B EMIT
## TYPE
48 EMIT ;
: Cursor.Up ( n -- ) \ Make cursor go up n lines
<CSI> EMIT \ Tell Console handler that we're coming
## TYPE \ Send # of lines to go up
41 EMIT ;
: Cursor.Down ( n -- ) \ Make cursor go down n lines
<CSI> EMIT \ Tell Console handler that we're coming
## TYPE \ Send # of lines to go down
42 EMIT ;
: Cursor.Forward ( n -- ) \ Make cursor go forward n spaces
<CSI> EMIT \ Tell Console handler that we're coming
## TYPE \ Send # of spaces to go forward
43 EMIT ;
: Cursor.Backward ( n -- ) \ Make cursor go backward n spaces
<CSI> EMIT \ Tell Console handler that we're coming
## TYPE \ Send # of spaces to go backward
44 EMIT ;
: Cursor.Next.Line ( n -- ) \ Make cursor go down n lines & to col 1
<CSI> EMIT \ Tell Console handler that we're coming
## TYPE \ Send # of lines to jump down
45 EMIT ;
Base ! \ Put old Base back into effect