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

SAY^XGF(): Screen String

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

Description

This 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. If omitted, the current row and column positions are used. If specified, the row must be between 0 and IOSL-1, and the column must be between 0 and IOM-1.

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.

NOTE: For a discussion of valid video attribute codes for the video attribute parameter, please refer to 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, please refer to the $$READ^XGF(): Read Using Escape Processing API.

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

Output Parameters

$x and $y:

Set to position of the last character output.

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",0,"ERROR!","R1B1")

Example 3

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

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

 


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.