Previous Top Index Next

External Ansi Functions (DOS+UNIX)

The following routines are available after loading the library file ansi.r with the command: CALL import "ansi.r".

In the 32BIT version of rexx, Generoso Martello added most of the following routines as builtin. The advantage is that ANSI.SYS is no more required and they are much faster. Please refer to the README.32bit file for more informations.

ANSIATTR(attribute)

Change the text attribute. attribute can take the values NORMAL, BOLD, UNDERLINE, BLINK, REVERSE, UNVISIBLE
CALL ansiattr("normal")
CALL ansiattr("bold")

ANSICLS()

Clear screen.
CALL ansicls

ANSICOLOR(forecolor[,backcolor])

Set the foreground and background color, colors can the the following values BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE. The forecolor can also take the prefix BOLD. In case of a wrong color ERROR will be returned
CALL ansicolor("boldred")
CALL ansicolor("white","green")

ANSICURSORDOWN([n])

Move cursor n lines down (default=1)
CALL ansicursordown

ANSICURSORLEFT([n])

Move cursor n columns left (default=1)
CALL ansicursorleft

ANSICURSORRIGHT([n])

Move cursor n columns right (default=1)
CALL ansicursorright 2

ANSICURSORUP([n])

Move cursor n lines up (default=1)
CALL ansicursorup 5

ANSIERASEEOL()

Clear from cursor position until end of line.
CALL ansieraseeol

ANSIGOTO(x,y)

Move cursor to position x,y
CALL ansigoto 10,5

ANSILOADCURSOR()

Load cursor position, which was previously saved
CALL ansisavecursor
....
CALL ansiloadcursor

ANSIMODE(mode)

Changes the Video mode to mode. Mode can take the values:
0 40x25 text mode black and white
1 40x25 text mode color
2 80x25 text mode black and white
3 80x25 text mode color
4 320x200 graphics mode color
5 320x200 graphics mode black and white
6 640x200 graphics mode black and white
CALL ansimode 3 /* 80x25 text mode */
CALL ansimode 0 /* 40x25 text mode */

ANSISAVECURSOR()

Save cursor position, which can be restored later
CALL ansisavecursor


Previous Top Index Next