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

AVEVA™ Unified Engineering

Substring Definition by Parts

  • Last UpdatedApr 27, 2023
  • 2 minute read

You can define a substring by reference to the constituent parts of the original string. A part of a string is defined by delimiters, which are user-definable.

The substring required is specified by following the code word with a substring descriptor of the form:

(P-n1:n2)

P indicates that n1 and n2 refer to delimiter numbers and ‘-‘ indicates the character used as the delimiter. If omitted, ‘/’ is assumed. The delimiter must not be numeric.

n1 and n2 are integers that indicate respectively the delimiter numbers at which the substring is to start and finish; the delimiter before n1 is always included in the output substring but the delimiter after n2 is always excluded. If n1 is omitted then the substring starts at the beginning of the ‘parent’ string, and if n2 is omitted then the substring ends at the end of the ‘parent’ string. The start and end of the ‘parent’ string are always assumed to be delimiters. For example:

If #PIPE expands to the parent string ‘/ZONE-4/PIPE-6’ then

#PIPE(P/2:) expands to ‘/PIPE-6’ and

#PIPE(P-:2) expands to ‘/ZONE-4/PIPE’

EIt is possible to append a number of substring definitions (both character type and part type) to a code word. These are processed sequentially, left to right. Any number of substring definitions is allowed. For example:

#PIPE(P2:)(C2:) expands to ‘PIPE-6’

There is a special form of the substring descriptor,

()

The substring descriptor is shorthand for (C1:)

The form can be used for putting codewords back to back in a text string where the other codeword delimiters are not suitable, for example, when a space is not required between codeword data. For example:

#POS #NAME

when expanded, contains a space between the two data items.

#POS()#NAME

does not contain a space between the two data items.

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