Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Engineering

Composing Text

  • Last UpdatedOct 25, 2022
  • 2 minute read

It is sometimes necessary to arrange text in multiple columns. The COMPOSE facility of the VAR command will help you do this.

For example, if you create the following text string:

!A = 'The quick brown fox jumped over the lazy dogs'

To compose the text, you might use the following command:

VAR !Table COMPOSE |$!A| WIDTH 11 C SPACES 2 |$!A| WIDTH 15 R

This would give the following output:

Index

Value

[1]

The quick    The quick brown'

[2]

brown fox     fox jumped over'

[3]

jumped over  the lazy dogs'

[4]

the lazy        '

[5]

dogs            '

COMPOSE always returns an array with at least one element. The number of array elements depends on the length of the text strings supplied and the width of each column. Notice that all of the STRING array elements are space-padded to the same length.

Following the COMPOSE keyword is a list of column definitions. For each column, there is a text string, such as |$!A| which evaluates to a text string, followed by the column layout keywords in any order:

Keyword

Effect

WIDTH n

Specifies the space-padded width of this column. If not specified, the width of the column will be the length of the input string.

SPACES n

Specifies the number spaces between this and the next column.

L

LEFT

Specifies text is to be aligned along the left edge of the column.

R

RIGHT

Specifies text aligned along the right edge of the column.

C

CENTRE

Specifies justification in the center of the column.

DELIMITER ' '

This can optionally be used to specify an alternative delimiter at which to break the input.

By default the text will be split at a white-space character such as space which may be removed from the output text.

If the delimiter is specified as an empty string, the text will be split at the column edge whatever the content.

TitleResults for “How to create a CRG?”Also Available in