4.2 CALL Statements in WEBROUTINEs

You may also use a CALL statement to redirect execution to another WEBROUTINE. The CALL statement has similar semantics to the TRANSFER statement, except the called WEBROUTINE returns control back to the calling WEBROUTINE and execution continues from that point onwards.

The CALL statement has the following properties:

Property

Description

WEBROUTINE

Specify the name of a WEBROUTINE to transfer to. You can specify another WAM, in this case WAM name followed by a WEBROUTINE name separated by a dot (e.g. #MYWAM.Browse).

A Service Name can also be specified, if prefixed with *SERVICE modifier.

The value can also be provided from a field, if prefixed with *EVALUATE modifier.

OnEntry

This property is used for mapping incoming fields and list into the target WEBROUTINE. This property can be one of:

*MAP_NONE (does not map any fields or lists),

*MAP_ALL (maps all required fields and lists),

*MAP_LOCAL (only fields and lists on WEBROUTINE's WEB_MAPs are mapped),

*MAP_SHARED (only WAM level WEB_MAP fields and lists are mapped, not WEBROUTINE level).

The default value is *MAP_ALL.

OnExit

This property used for mapping outgoing fields from the target WEBROUTINE. This property can be one of:

*MAP_NONE (does not map any fields or lists),

*MAP_ALL (maps all required fields and lists),

*MAP_LOCAL (only fields and lists on WEBROUTINE's WEB_MAPs are mapped),

*MAP_SHARED (only WAM level WEB_MAP fields and lists are mapped, not WEBROUTINE level).

The default value is *MAP_ALL.

 

The following are some examples of CALL statement:

CALL WEBROUTINE(Browser)
CALL WEBROUTINE(#MYWAM.Browser)
CALL WEBROUTINE(*SERVICE EmployeeBrowse)
CALL WEBROUTINE(*EVALUATE #WEBRTN)