Passing Parameters

PSL enables you to specify whether code generated in one procedure can be passed to another procedure. Parameters can be passed as reference by value (one-way passing), reference by name (two-way passing), arrays, or objects.

Refer to the following sections for additional information.

Declaring Procedures

Passing Arrays

Passing Entities by Reference

Passing Objects

General Guidelines

Acceptable:

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

do SUB(.acn)

quit

Preferred:

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

do SUB(acn.bal)

quit

 

This provides the following benefits:

Example

      type RecordDEP dep=Db.getRecord(“DEP”,”:CID”)

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

 

      do CHECK(dep.odt,dep.bal,dep.irn,cif.nam,cif.taxid)

 

CHECK(String ODT,    // odt      /REQ/MECH=VAL

      Number BAL,    // balance  /REQ/MECH=VAL

      Number IRN,

      String NAM,

      String TAXID)

      set INT=BAL*IRN

      set DATA=NAM_”, “_TAXID

*CID and ACN must be defined prior to the getRecord statements.

a (Number cid, // Account Number

String x, // String

Date date) // Date

is the same as:

a (Number CID, String x, Date date)