Variables and Objects

General

Variable Syntax

PSL has specific interpretations for each of these characters. For example, PSL interprets commas and spaces as expression delimiters; underscores as string concatenators; and periods as extension delimiters.

Example

type RecordCIF cif = Db.getRecord(“CIF”,”:ACN”)

set NAM   = cif.lnm

set DOB   = cif.dob

set TAXID = cif.taxid

________________________________________________________

type ResultSet rs = Db.select(“CID,BAL,IRN”,”DEP”)

while rs.next() do {

set data = rs.getRow()

set CID = rs.getCol(1)

set INT = rs.getCol(1) * rs.getCol(2)

}

Host Variables

Methods that accept parameters that define the access keys (accessKeys) or an SQL WHERE clause (whereClause) must use host variables. That is, the parameter must be preceded by a colon (:). Previously, it was acceptable to use named variables.

Example

Unacceptable:

type RecordACN acn = Db.getRecord("ACN","CID")

Acceptable:

type RecordACN acn = Db.getRecord("ACN",":CID")

 

Example

Unacceptable:

type ResultSet rs = Db.select("ETC,TAMT","HIST","CID=CID ...AND TAMT>XAMT")

Acceptable:

type ResultSet rs = Db.select("ETC,TAMT","HIST","CID=:CID ...AND TAMT>:XAMT")

When Standard is Enforced: v7.0