subcalls.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
VioSetAnsi (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_VIO
 
USHORT VioSetAnsi(fAnsi, hvio)
USHORT fAnsi;    /* ANSI flag    */
HVIO hvio;       /* video handle */
 
The VioSetAnsi function enables or disables processing of ANSI escape
sequences by setting or clearing the ANSI flag, which specifies whether the
VioWrtTTY function processes ANSI escape sequences.
 
When a screen group is started, ANSI processing is enabled for the screen
group.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
fAnsi      Specifies the ANSI flag, which determines whether ANSI processing
           is enabled or disabled. If this flag is ANSI_ON, ANSI processing
           is enabled. If the flag is ANSI_OFF, ANSI processing is
           disabled.
 
hvio       Identifies an advanced video-input-and-output (AVIO) presentation
           space. For AVIO programs, this handle must have been created
           previously using the VioCreatePS function. For other programs,
           hvio must be NULL.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be the following:
 
     ERROR_VIO_INVALID_HANDLE
 
Example
 
This example displays two identical strings. Before the first string is
displayed, VioSetAnsi disables ANSI processing. As a result, the VioWrtTTY
function displays the ANSI escape sequences as characters. Before VioWrtTTY
displays the second string, VioSetAnsi enables ANSI processing, and the
string is displayed in inverse video (black characters on a white
background):
 
VioSetAnsi(ANSI_OFF, 0);          /* disables ANSI processing */
VioWrtTTY("\33[7mHello World\33[0m\n\r", 21, 0);
VioSetAnsi(ANSI_ON, 0);           /* enables ANSI processing  */
VioWrtTTY("\33[7mHello World\33[0m\n\r", 21, 0);
 
See Also
 
VioCreatePS, VioGetAnsi, VioWrtTTY