MSM-Workstation
Macros

Go back to the alphabetic list of macros
Go back to the first page of this tutorial

%%Return ( [ ReturnCode ] [ , [ Parameters ] [ , Hide ] ] )

Exit and close a window, optionally set a return code and parameters array.

ReturnCode A value indicating how the window was exited. Default is %%RetNormal. The value is placed in %%RetCode.

Parameters The name of an array.

Hide A flag which if true causes the window to be hidden but not destroyed.

The macro %%Return causes return from a window. The window is closed, and destroyed unless Hide indicates a true value. A ReturnCode may be returned to the calling window, where it may be inspected using the macro %%RetCode.

The parameter Parameters may be the name of an array. If this is the case, the contents of the array specified as the parameter Parameters in the macro %%Cancel will be merged into the array specified as the parameter Parameters in the corresponding macro %%DoWin or %%OpenWin. Using this mechanism, it will be possible to return values to the calling environment, without needing to know the actual or formal name of the array being used.

If Hide has a true value, the window is hidden but not destroyed. This may be done to allow faster operation when reuse is likely.

For closing the current window, the macros %%Cancel and %%Return are the most appropriate.

For closing other windows, non-modal ones that were opened using %%OpenWin, or modal ones that used the option Hide when a %%Cancel or %%Return was executed, the macro %%CloseWin is the most appropriate.

The macro %%KillWin should only be used for windows that were created by other software than the MSM ViEW-Builder, e.g. by directly merging structures into ^$Window, or by using the macro %%MergeWin.

Examples

%%Return
Without parameters, the macro causes the removal of a window, and causes no special parameters to be returned. The exit-status in %%RetCode will be %%RetNormal.

%%Return(0,temp,1)
When the second parameter is present, the contents of the array mentioned in this parameter will be merged into the parameter-array that was specified whtn the window was invoked. The third parameter indicates that the window will be hidden but not destroyed.

%%Return(123)
The exit-status in %%RetCode will be set to the application-specific value 123

See also

%%Cancel, %%Do and %%DoWin.