Code Fragment Virtual Field Derivation

LANSA Technical

Code Fragment Virtual Field Derivation

A code fragment does not support the full range of RDML/X commands. In Version 11, the user is limited to constructs such as If, Case, Dountil, Dowhile, Change, Assign.

At execution time, the code fragment will have read only access to all fields in the file.

In the following example, the PSLMST file has two fields SURNAME and GIVENAME. SURNAME is A(20) and GIVENAME is A(20). If the SURNAME was "Smith              " and SURNAME was "John               ", a simple concatenation virtual would create a virtual field called FULLNAME with a result of  "Smith              John               ".

Using the following code fragment:

#FULLNAME := #SURNAME.Trim + ', ' + #GIVENAME.Trim

 

the code fragment virtual field FULLNAME will have a result of "Smith, John".

Ý 3.3.6 Code Fragment