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

CHGA^XGF(): Screen Change Attributes

Reference Type: Supported, Category: XGF Function Library, ICR#: 3173

Description

The CHGA^XGF 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:

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.

Examples

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")