Skip to main content

Terminal Functions and Control Characters

All of these functions and characters are used with the standard WRITE /<mnemonic> syntax. For basic information on this syntax, see the Overview of I/O Commands in the Caché I/O Device Guide, and the WRITE command in the Caché ObjectScript Reference.

Terminal Functions

The following terminal functions are used for text formatting and editing. They work inside windows and with WMODE(-1) as well. The standard WRITE options (*, #, ! and ?n) work as expected inside windows.

Mnemonic

Action

/bell Rings the bell
/boff Blink off
/bon Blink on
/bs(n) Backspace n positions (stop at upper left corner)
/clr Clear the window.
/color(f,b) Set foreground (f) and background (b) colors (0-7)
/cub(n) Cursor backward n columns (stop at left margin).
/cud(n) Cursor down n lines (stop at bottom line)
/cuf(n) Cursor forward n columns (stop at right margin).
/cup(l,c) Position cursor at (line, column); origin is (1,1).
/cuu(n) Cursor up n lines (stop at top line).
/dch(n) Delete n characters
/dl(n) Delete n lines
/ech(n) Erase n characters (cursor does not move)
/ed0 Erase from cursor to end of screen
/ed1 Erase from beginning of screen to cursor
/ed2 Erase complete screen
/el0 Erase from cursor to end of line
/el1 Erase from beginning of line to cursor
/el2 Erase complete line
/eol Erase to the end of line
/eos Erase to the end of screen
/hoff Highlight off
/hon Highlight on
/ich(n) Insert n blanks
/il(n) Insert n lines
/ind(n) Same as lf(n)
/lf(n) Line feed n times (scrolls if necessary)
/ri(n) Reverse line feeds n times (scrolls if necessary)
/roff Reverse off
/ron Reverse on
/sp(n) Prints n blanks
/uoff Underline off
/uon Underline on

Control Characters

According to the ANSI standard, the following control characters produce their usual effect:

Character

ASCII

Action

BELL 7 Ring the bell
BS 8 Backspace 1 character
CR 13 Carriage return (go to column 0)
FF 12 Form feed (clear window)
LF 10 Line feed
Important:

All other control characters are ignored!

This means that literal control sequences (such as W $c(27),"["...) will not produce the expected behavior. All editing and formatting functions should be coded using the WRITE /<mnemonic> syntax.

FeedbackOpens in a new tab