7.49.2 FUNCTION Examples
Example 1: Set the possible options for a batch subroutine RDML program:
FUNCTION OPTIONS(*NOMESSAGES *HEAVYUSAGE)
Example 2: Set possible options for an interactive "pop up selector" RDML subroutine:
FUNCTION OPTIONS(*NOMESSAGES *DEFERWRITE)
Example 3: Receive data structure DATAFILE into this function:
FUNCTION OPTIONS(*DIRECT) RCV_DS(DATAFILE)
This requires a file called DATAFILE to be defined to LANSA. The real fields on this file can be received as a data structure from another function. A dummy field on the end of the data structure would avoid the need to recompile each function referencing the data structure each time fields are added within the data structure. As long as the length of the data structure remains consistent, the functions which use it would not require recompilation (unless the existing fields are changed in length, position or type within the data structure).
Example 4: Receive working list #ORDERLINE into this function
FUNCTION OPTIONS(*DIRECT) RCV_LIST(#ORDERLINE)
DEF_LIST NAME(#ORDERLINE) FIELDS(#ORDLIN #PRODUCT #QUANTITY #PRICE) TYPE(*WORKING)