CloseWindow(obj, windowType)

Closes a window in the Analytica user interface.

  • «obj» is an identifier.
  • «windowType» is one of the following:
"Diagram": Closes the Diagram window for Module «obj».
"Object": Closes the Object window for «obj».
"Result": Closes the Result window for «obj». «Obj» should be a variable.
"EditTable": Closes the edit table window for «obj».
"Outline": Closes (hides) the Outline window. The «obj» parameter is ignored.
"Typescript": Closes the Typescript Window. The «obj» parameter is ignored.

There is no meaningful return value.


If you use this to close the last open window, not counting the typescript window, it will close the model. The user will be asked whether he wishes to save any changes if any changes have occurred.

The function fails quietly, meaning that it does not issue an error if the requested window is not open, or if you tell it to close a diagram for a non-module, a result for a non-variable, etc. Error messages are issued when the «obj» parameter does not identify an existing object or «windowType» is not a recognized value.

The function is usually used in a button's OnClick event expression.


Close the diagram for Module Mo2

CloseWindow(Mo2, "Diagram")

Close the Object window for Va1

CloseWindow(Va1, "Object")

Close the Outline window (note: «obj» ignored, so can be anything)

CloseWindow(Null, "Outline")

From ADE

When evaluated in the Analytica Decision Engine (ADE), it calls IAdeUIWindowCallbacks::CloseWindow(...), from which the parent application implements the logic to jump to the requested UI window. To receive this callback, the parent application must have previously registered the callback with ADE using CAEngine::SetCallbackObject( ).


Introduced in Analytica 5.0.

See Also


You are not allowed to post comments.