Kernel 8.0 APIs Banner [skip navigation]
Office of Information & Technology (OIT) Banner

CHGA^XGF(): Screen Change Attributes

Reference Type: Supported, Category: XGF Function Library, Integration Agreement: 3173

Description

This API changes individual video attributes for subsequent screen WRITEs.

Use this API to change individual video attributes for subsequent output. This API is different from SETA^XGF in that individual video attributes can be set without affecting all video attributes at once.

A call to the PREP^XGF(): Screen/Keyboard Setup API must be made at some point prior to calling CHGA^XGF.

The attribute codes are not case sensitive. You can append them if you want to set more than one attribute. If you include more than one attribute, their order is not important.

B0 and B1 turn off and on the blink attribute; I0 and I1 turn off and on the intensity attribute; R0 and R1 turn off and on the reverse attribute; U0 and U1 turn off and on the underline attribute. E1 turns off all attributes. G0 and G1 turn off and on recognition of an alternate graphics character set so that you can use special graphic characters, in particular those set up by Kernel's GSET^%ZISS API. To use graphics characters, be sure you turn on graphics first (with G1) and turn graphics off afterwards (with G0).

The change in attribute remains in effect until another CHGA^XGF, PREP^XGF(): Screen/Keyboard Setup, or SETA^XGF(): Screen Video Attributes API call is made. If you want only a temporary change in attribute, SAY^XGF may be a better function to use.

Format

  CHGA^XGF(atr_codes)

Input Parameters

atr_codes:

(required) Codes are as follows:

  • B1-Blink on

  • B0-Blink off

  • E1-Turn all off

  • G1-Graphics on

  • G0-Graphics off

  • I1-Intensity high

  • I0-Intensity normal

  • R1-Reverse video on

  • R0-Reverse video off

  • U1-Underline on

  • U0-Underline off

Output Parameters

xgcuratr:

This variable always holds the current screen attribute coded as a single character, and is updated when you call CHGA^XGF.

$x,$y:

Left unchanged.

NOTE: See also: SETA^XGF(): Screen Video Attributes API.

Example 1

To clear the screen in blinking, reverse video and high intensity, do the following:

>D CHGA^XGF("R1B1I1"),CLEAR^XGF(0,0,23,79)

Example 2

To print Hello World, do the following:

>D CHGA^XGF("I1"),SAY^XGF(,,"Hello ")
>D CHGA^XGF("U1"),SAY^XGF(,,"World")

Example 3

To draw the bottom of a small box, do the following:

>D CHGA^XGF("G1")
>D SAY^XGF(,,IOBLC_IOHL_IOHL_IOBRC)
>D CHGA^XGF("G0")

 


VA (Internet) / VA(Intranet) / OI / PD / Site Map / Terms of Use / VA Privacy Policy / Accessibility

Reviewed/Updated: August 26, 2011

If you have questions, need more information, or are having accessibility problems with this website, please contact us by E-Mail: Webmasters, Phone: 510-768-6800, or FAX: 510-768-6850.