Previous Topic Next topic Print topic


GRAPHIC Function

Purpose

Converts character data to GRAPHIC data. Other data types are first converted to character, and then to the GRAPHIC.

Returns the graphic value of x, with a length in graphic symbols specified by y.

The content of x is checked for validity during conversion, using the same rules as for checking graphic constants.

Syntax

GRAPHIC(x[,y])

Parameters

x and y are expressions.

Description

If x is GRAPHIC, it is subject to a length change, with appropriate padding or truncation. If x is nongraphic, it is converted to character, if necessary.

When necessary, y is converted to a real fixed-point binary value. If y is omitted, the length is determined by the rules for type conversion. y must not be negative.

If y = 0, the result is the null graphic string.

The following rules apply:

  • If y is greater than the length needed to contain the graphic string, the result is padded with graphic blanks.
  • If y is less than the length needed to contain the graphic string, the result is truncated.

Restrictions

None.

Previous Topic Next topic Print topic