|
|
|
|
|
- Codes executed at closing
- Closing according to the type of window
- Last project window
- First project window
- Value returned to the Open function
- Value returned when closing a child window
- Alt + F4 keys
- Equivalence
Close (Function) In french: Ferme Closes a WINDEV window (and returns a value if necessary). // Close the "WIN_Edit" window Close(WIN_Edit)
Syntax
Close([<Window> [, <Returned value> [... [, <Returned value N>]]]])
<Window>: Optional window name Name of window to close. If this parameter is not specified or if it corresponds to an empty string (""), the current window is closed. <Returned value>: Type corresponding to the returned value (optional) Value returned by the window when it is closed.
You have the ability to return: - simple types (character string, boolean, ...).
- advanced types: structure, dynamic structure, class, advanced type, array, associative array, queue, stack, list.
<Returned value N>: Type corresponding to the returned value (optional)
Remarks Codes executed at closing - When closing a window:
- The current process is permanently interrupted.
- The "Closing" event of the window is executed.
- If SetFocusAndReturnToUserInput is called in the "Closing" event, the window is not closed.
- If Close is run in a procedure called by Timer, WinStatus or CurrentWin must be used to confirm the existence of the window to close, otherwise all open windows may be closed. For example:
// Procedure called by timer Window is string Window = CurrentWin() IF Window <> "Window name" THEN Close() END
Closing according to the type of window - If the window to close is a parent window with child windows, these child windows will be closed first (their closing code is run).
- If the window to close is a child window, the parent window becomes the current window. The "gain of focus" code of parent window is run.
Last project window If the last window is closed, the "Closing" event of the project is executed before the end of the program. Alt + F4 keys Pressing Alt + F4 can trigger several behaviors: - If the window contains an "Abandon" button, the WLanguage event associated with the abandon button is executed.
- If the window has a button with Alt + F4 as keyboard shortcut, the WLanguage event associated with this button is executed.
- If the window does not contain an "abandon" button, or a button with Alt + F4 as keyboard shortcut, the closing process of the window is executed and the window is closed (except if SetFocusAndReturnToUserInput is called).
- If a window is opened from a program in external language, Alt + F4 returns "ESC" in WdKey.
Equivalence The following line of code: WinStatus(<Window>, NotFound) is equivalent to:
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|