INVOKE Message Structure

INVOKE causes a named program to be activated, a message sent to the activated program, and a message returned from the activated program. The sending program remains in waiting until a subsequent message is received. The structure of the message is defined by the $TRANS section of the ProgramCode .scr file of the activated transaction. This message and the contents of the variable CRT-CONTROL, which contains fields such as CRT-ERROR-NBR, comprise the interface between the requesting and the requested programs. No other working-storage variables are shared.

Note: If CRT-ERROR-NBR contains a nonzero value at the time of the INVOKE, the called program might read it as an error.

This is the same interface used to communicate with online programs by the Lawson presentation and transaction managers. By reusing this protocol, INVOKE offers the benefits of encapsulated objects as well as a familiar interactive front-end for those objects. This strategy allows for separate testing and use of smaller programs with subsets of functionality, rather than creating very large programs.

For more information on the structure of the $TRANS section of an online program, see Transaction Data Section.