Object Properties in PSL

PSL supports the following processing for object properties.

Nested Object Expressions

The PSL compiler supports nested object expressions, typically in conjunction with the implementation of intrinsic M functions.

Example 1:

type RecordDEP dep = Class.new("RecordDEP")

set dep.bal = 2000

write dep.bal.des.extract(1,10)

write dep.bal.curVal.justify(12,2)

quit

 

Example 2:

type String x = "abc#def@ghi#jkl@mno#pqrabc#def@ghi#jklmno#pqr"

write !,x.piece("@",1).piece("#",2).extract(2)

set x.piece("@",1) = 5

quit

The write command above prints e, which is the highlighted character. The set command then changes x from:

abc#def@ghi#jkl@mno#pqrabc#def@ghi#jklmno#pqr

to

5@ghi#jkl@mno#pqrabc#def@ghi#jklmno#pqr