PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Codes executed at closing
  • Closing according to the type of window
  • Last project window
  • First project window
  • Alt + F4 keys
  • Equivalence
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Closes a WINDEV window (and returns a value if necessary).
Versions 16 and later
Linux This function is now available for WINDEV applications in Linux.
New in version 16
Linux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WINDEV applications in Linux.
Versions 24 and later
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
WEBDEV - Server codeWindowsLinux This function is available only to simplify the Webification of WINDEV projects. In a WEBDEV site, this function has the same behavior as PageCloseDialog or ContextClose, according to each case.
New in version 24
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
WEBDEV - Server codeWindowsLinux This function is available only to simplify the Webification of WINDEV projects. In a WEBDEV site, this function has the same behavior as PageCloseDialog or ContextClose, according to each case.
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
WEBDEV - Server codeWindowsLinux This function is available only to simplify the Webification of WINDEV projects. In a WEBDEV site, this function has the same behavior as PageCloseDialog or ContextClose, according to each case.
Example
// Close the "WIN_Edit" window
Close(WIN_Edit)
Versions 19 and later
WindowsLinux
// Close the "WIN_EditLogin" window
// and retrieve several return values
Close(WIN_EditLogin, LastName, FirstName)
New in version 19
WindowsLinux
// Close the "WIN_EditLogin" window
// and retrieve several return values
Close(WIN_EditLogin, LastName, FirstName)
WindowsLinux
// Close the "WIN_EditLogin" window
// and retrieve several return values
Close(WIN_EditLogin, LastName, FirstName)
Syntax
Close([<Window name> [, <Returned value> [... [, <Returned value N>]]]])
<Window name>: Optional character string (with or without quotes)
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, ...).
  • Versions 15 and later
    advanced types: structure, dynamic structure, class, advanced type, array, associative array, queue, stack, list.
    New in version 15
    advanced types: structure, dynamic structure, class, advanced type, array, associative array, queue, stack, list.
    advanced types: structure, dynamic structure, class, advanced type, array, associative array, queue, stack, list.
<Returned value N>: Type corresponding to the returned value (optional)
Versions 19 and later
WindowsLinux Value N returned by the window when it is closed (if several values are returned).

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.
New in version 19
WindowsLinux Value N returned by the window when it is closed (if several values are returned).

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.
WindowsLinux Value N returned by the window when it is closed (if several values are returned).

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.
Remarks

Codes executed at closing

  • When closing a window:
    1. The current process is permanently interrupted.
    2. The "Closing" window event is run.
  • If ReturnToCapture 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 project window is closed, the "Closing" project event is run before the end of the program.

First project window

Alt + F4 keys

Pressing Alt + F4 can trigger several behaviors:
  • If the window contains an "Abandon" button, the process associated with the abandon button is run.
  • If the window contains a button whose shortcut is Alt + F4, the process associated with this button is run.
  • If the window contains no abandon button and no button whose shortcut is Alt + F4, the closing process of window is run and the window is closed (except if ReturnToCapture is called).
  • If a window is opened from a program in external language, Alt + F4 returns "ESC" in WdKey.

Equivalence

The following code line:
WinStatus(<WindowName>, NotFound)
is equivalent to:
Close(<WindowName>)
Component : wd240obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Aula 1163 WinDev Curso Iniciante ErpAmarildoniciante 020 Codigo do SELECIONA EMPRESA
VAMOS FAZER O CODIGO PARA SELECIONAR A EMPRESA,
CLICANDO NA TABELA

In this class today
LET'S MAKE THE CODE TO SELECT THE COMPANY,
CLICKING ON THE TABLE

En esta clase de hoy

VAMOS HACER EL CODIGO PARA SELECCIONAR LA EMPRESA,
CLICANDO EN LA TABLA

//=================
gn_retorna_id_empresa_codigo=TABLE_QRY_RELACAO_EMPRESAS.COL_EmpresaID
gs_retorna_nome_Empresa=TABLE_QRY_RELACAO_EMPRESAS.COL_Razao_social
Close(WIN_RELACAO_EMPRESAS,gn_retorna_id_empresa_codigo,gs_retorna_nome_Empresa)
//=================

Blog com video e exemplo

http://windevdesenvolvimento.blogspot.com.br/2017/05/aula-1163-windev-curso-iniciante.html

https://www.youtube.com/watch?v=qNOwvs8Kfxo




De matos
28 May 2017