MSM-Workstation
Macros

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

%%CloseWin ( WinName )

Destroys a window.

WinName A string literal (without quotes) representing the name of a window, or an at-sign followed by the name of a local variable (@name) where the value of that variable is expected to be equal to the name of a window at run-time.

The macro %%CloseWin performs any Destroy action logic, first for all components and then for the window, and then destroys the window. It should be used when a window created by %%OpenWin is no longer required, allowing the Destroy event to close data controls and perform other necessary cleanup.

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

%%CloseWin(Test)
Close the window called "Test".

%%CloseWin(@which)
Close the window identified by the value of local variable which.

See also

%%OpenWin