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

SAY^XGF(): Screen String

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

Description

The SAY^XGF API outputs a string to the screen (with optional positioning and attribute control).

Use this API rather than the M WRITE command to output strings to the screen. The row and column parameters specify where to print the string:

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

You can specify row and column parameters relative to the current $X and $Y by specifying + or - to increment or decrement $X or $Y by 1. You can increment or decrement by more than 1 if you add a number as well (e.g., "-5" or "+10").

NOTE: You must use quotes to pass a "+" or "-"; otherwise, to specify exact locations for row and column, pass numbers.

Without the fourth argument for video attribute, SAY^XGF displays the string using the current video attribute. With the fourth argument, SAY^XGF displays the string using the attributes you specify. SAY^XGF changes the video attribute only for the output of the string; upon termination of the function, it restores video attributes to their state prior to the function call.

REF: For a discussion of valid video attribute codes for the video attribute parameter, see the SETA^XGF(): Screen Video Attributes API.

Format

  SAY^XGF([row][,col,]str[,atr])

Input Parameters

row:

(optional) Row position to start WRITE.

col:

(optional) Column position to start WRITE.

str:

(required) String to WRITE.

atr:

(optional) Video attribute with which to WRITE string.

NOTE: For description of atr codes, see the $$READ^XGF(): Read Using Escape Processing API.

REF: See also: IOXY^XGF(): Screen Cursor Placement and SAYU^XGF(): Screen String with Attributes APIs.

Output Variables

$X and $Y:

Set to position of the last character output.

Examples

Example 1

For example, to print "Hello, World" in the center of the screen, in the current video attribute, do the following:

>D SAY^XGF(11,35,"Hello World")

Example 2

To print "ERROR!" at (row,col) position ($X+1,$Y+5), in reverse and bold video attributes, do the following:

>D SAY^XGF("+","+5","ERROR!","R1B1")

Example 3

To print "..." at the current cursor position, in the current video attribute, do the following:

>D SAY^XGF(,,"...")