Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If the angle bracket syntax appears on the left side of an assignment statement, then a dynamic Replace() will occur. For example:

Code Block
CUST_REC<3,2> = 'JEFFERSON'

...

is equivalent to

Code Block
CUST_REC = Replace( Cust_Rec,3,2,0, 'JEFFERSON')

...

In this example, the third field, second value is replaced with the string "JEFFERSON". Notice that the 0 (zero) is required in the Replace syntax but not in the angle bracket syntax. Also notice that there is no space between the variable name and the first angle bracket.

...

If the angle bracket syntax is used in any expression to the right of an assignment statement, then an Extract is implied. Notice that:

Code Block
NAME = REC<4>

...

is equivalent to

Code Block
NAME = Extract(REC,4,0,0)

...

Example

 

Code Block
* Extract the third field, Nth value.
INV.DT = MASTER<3,N>
/* Extract the fifth field, Nth value, and subvalue number that is yielded by LINE + 1. */
PROD = MASTER<5,N,LINE + 1>
/* Replace the sixth field, Nth value of MASTER with the second field of PM. */
MASTER<6,N> = PM<2>
* Replace field four of MASTER with "WALL CONSTRUCTION".
MASTER<4> = 'WALL CONSTRUCTION'

 

...