Previous Topic: READ TRANSACTIONNext Topic: TRANSFER


RETURN

Purpose

Passes control to a higher level dialog or function in the application thread.

Syntax

►►─── RETurn ─┬──────────────────┬─┬────────────┬─┬────────────┬─ . ──────────►◄
              ├─ TO dialog-name ─┤ └┬─ CLEAR ─┬─┘ └─ CONTinue ─┘
              └─ to ─┬─ TOP-─┬───┘  └─ CLR ───┘
                     └─ ALL ─┘

Parameters

TO dialog-name

Introduces the name of a higher level dialog to which control passes.

Dialog-name can be the name of a variable data field that contains the dialog name or the dialog name itself, enclosed in single quotation marks.

to TOP

Specifies the highest level to which control can pass.

ALL can be used in place of to TOP.

CLEAR

Specifies that record buffers are reinitialized and currencies are released for the dialog receiving control.

CLEAR is ignored if the receiving dialog is at the top of a nested application structure.

CLR can be used in place of CLEAR.

CONTinue

Specifies that control returns to the first command in the premap process of the dialog receiving control.

If CONTINUE is not specified, control returns to the mapout operation of the dialog that receives control. If the receiving dialog is at the top of a nested application structure, CONTINUE is ignored.

Usage

Considerations

Examples

The examples below show the use of the RETURN command in response processes from dialogs used in the two sample applications shown in Application Thread:

Example 1: Using RETURN with the LINK command

In Example 1 of Application Thread, dialog UPDATEC passes control to the dialog UPDATEO by means of a LINK command. The following response process from dialog UPDATEO returns control to the command following the LINK command in dialog UPDATEC:

READY USAGE-MODE IS UPDATE.
MODIFY ORDOR.
RETURN.

Example 2: Using RETURN with the INVOKE command

In Example 2 of Application Thread, dialog UPDATEC passes control to the dialog UPDATEO by means of an INVOKE command. The following response process from dialog UPDATEO returns control to the mainline dialog RDCUST# and reinitializes the record buffers associated with RDCUST#:

READY USAGE-MODE IS UPDATE.
MODIFY ORDOR.
RETURN TOP CLEAR.

Example 3: Transferring control within the same level

In Example 2 of Application Thread, dialog UPDATEO provides the ability to transfer to dialog ADDORDR. ADDORDR prompts the user for new order information. The following response process from dialog ADDORDR adds a new ORDOR record to the database and returns control to the mapout operation of dialog UPDATEC:

READY USAGE-MODE IS UPDATE.
STORE ORDOR.
RETURN.