PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Processes performed during the 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
  • Combination of [ALT] and [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 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Universal Windows 10 App This function is now available for the Windows Phone applications.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Close the "WIN_Edit" window
Close(WIN_Edit)
Versions 19 and later
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUser code (UMC)
// Close the "WIN_EditLogin" window
// and retrieve several return values
Close(WIN_EditLogin, LastName, FirstName)
New in version 19
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUser code (UMC)
// Close the "WIN_EditLogin" window
// and retrieve several return values
Close(WIN_EditLogin, LastName, FirstName)
Reports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUser code (UMC)
// 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.
WINDEVWindows MobileJava This value is retrieved only if the window was opened by Open.

Versions 18 and later
AndroidiPhone/iPadApple WatchUniversal Windows 10 App This value is retrieved only if the window was opened by OpenChild.
New in version 18
AndroidiPhone/iPadApple WatchUniversal Windows 10 App This value is retrieved only if the window was opened by OpenChild.
AndroidiPhone/iPadApple WatchUniversal Windows 10 App This value is retrieved only if the window was opened by OpenChild.
AndroidiPhone/iPadApple WatchUniversal Windows 10 App This value is retrieved only if the window was opened by OpenMobileWindow (or by OpenChild).
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
WINDEVReports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUser code (UMC) Value N returned by the window when it is closed (if several values are returned).
WINDEVWindows Mobile This value is retrieved only if the window was opened by Open.

iPhone/iPadApple Watch This value is retrieved only if the window was opened by OpenMobileWindow (or by OpenChild).
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
WINDEVReports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUser code (UMC) Value N returned by the window when it is closed (if several values are returned).
WINDEVWindows Mobile This value is retrieved only if the window was opened by Open.

iPhone/iPadApple Watch This value is retrieved only if the window was opened by OpenMobileWindow (or by OpenChild).
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.
WINDEVReports and QueriesWindowsLinuxiPhone/iPadApple WatchWindows MobileUser code (UMC) Value N returned by the window when it is closed (if several values are returned).
WINDEVWindows Mobile This value is retrieved only if the window was opened by Open.

iPhone/iPadApple Watch This value is retrieved only if the window was opened by OpenMobileWindow (or by OpenChild).
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

Processes performed during the closing

  • When closing a window:
    1. The current process is permanently interrupted.
    2. The closing code of the window is run.
  • If ReturnToCapture is called in the closing process, the window is not closed.
  • If Close is run in a procedure called by Timer, the existence of the window to close must be checked with WinStatus or CurrentWin otherwise all the opened 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" code of project is run before the end of program.

First project window

iPhone/iPadApple Watch Close used on the first project window means that the application will be ended. This function must only be used for debugging because ending applications is not allowed by the license for this type of device.
WINDEVReports and QueriesWindows MobileJavaUser code (UMC)

Value returned to the Open function

Close can be used to return a value to Open.Close can be used to return one or more values to Open.
Reminder: A value can also be returned by ..ReturnedValue (<Window Name>..ReturnedValue) run before Close. In this case, a single value can be returned.
Examples:
  • The user must type a password in a window. This password is retrieved when this window is closed and it is returned to Open:
    MyPassword = Open(WIN_EditPassword)
    IF MyPassword <> "" THEN
    Info("Wrong password")
    END

    // -- Click code on "OK" button in the "WIN_EditPassword" window
    // The user types his password in the EDT_Password control
    // and validates the window.
    Close("", EDT_Password)
  • Versions 19 and later
    The user must type a login and a password in a window. The login and password are retrieved when closing this window and they are returned to Open:
    (MyLogin, MyPassword) = Open(WIN_EditPassword)
    IF MyLogin <> "" OR MyPassword <> "" THEN
    Info("Wrong login or password")
    END

    // -- Click code on "OK" button in the "WIN_EditPassword" window
    // The user types his login and password
    // in the EDT_Password control and validates the window.
    Close("", EDT_Login, EDT_Password)
    New in version 19
    The user must type a login and a password in a window. The login and password are retrieved when closing this window and they are returned to Open:
    (MyLogin, MyPassword) = Open(WIN_EditPassword)
    IF MyLogin <> "" OR MyPassword <> "" THEN
    Info("Wrong login or password")
    END

    // -- Click code on "OK" button in the "WIN_EditPassword" window
    // The user types his login and password
    // in the EDT_Password control and validates the window.
    Close("", EDT_Login, EDT_Password)
    The user must type a login and a password in a window. The login and password are retrieved when closing this window and they are returned to Open:
    (MyLogin, MyPassword) = Open(WIN_EditPassword)
    IF MyLogin <> "" OR MyPassword <> "" THEN
    Info("Wrong login or password")
    END

    // -- Click code on "OK" button in the "WIN_EditPassword" window
    // The user types his login and password
    // in the EDT_Password control and validates the window.
    Close("", EDT_Login, EDT_Password)
Versions 18 and later
AndroidiPhone/iPadApple WatchUniversal Windows 10 App

Value returned when closing a child window

Close is used to return a value to the parent window that opened the child window.
Reminder: A value can also be returned by ..ReturnedValue (<Window Name>..ReturnedValue) run before Close.
The value returned by the child window can be read in the "Closing of a child window" process of the window that opened the child window (the one that called OpenChild): all you have to do is use ..ReturnedValue on the MyChildWindow keyword. The value returned by the child window can be read in the "Closing process of a child window" of the window that opened the child window (the one that called OpenMobileWindow or OpenChild): all you have to do is use ..ReturnedValue on the MyChildWindow keyword.
For example:
  • In the closing code of the child window, Close is used to return a parameter:
    Close("", MyParameter)
  • In the "Closing of a child window" process of the calling window, the name of the child window as well as the returned value can be retrieved by using the MyChildWindow keyword:
    // Close a child window
    NameChildWindow = MyChildWindow..Name
    ValueChildWindow = MyChildWindow..ReturnedValue
New in version 18
AndroidiPhone/iPadApple WatchUniversal Windows 10 App

Value returned when closing a child window

Close is used to return a value to the parent window that opened the child window.
Reminder: A value can also be returned by ..ReturnedValue (<Window Name>..ReturnedValue) run before Close.
The value returned by the child window can be read in the "Closing of a child window" process of the window that opened the child window (the one that called OpenChild): all you have to do is use ..ReturnedValue on the MyChildWindow keyword. The value returned by the child window can be read in the "Closing process of a child window" of the window that opened the child window (the one that called OpenMobileWindow or OpenChild): all you have to do is use ..ReturnedValue on the MyChildWindow keyword.
For example:
  • In the closing code of the child window, Close is used to return a parameter:
    Close("", MyParameter)
  • In the "Closing of a child window" process of the calling window, the name of the child window as well as the returned value can be retrieved by using the MyChildWindow keyword:
    // Close a child window
    NameChildWindow = MyChildWindow..Name
    ValueChildWindow = MyChildWindow..ReturnedValue
AndroidiPhone/iPadApple WatchUniversal Windows 10 App

Value returned when closing a child window

Close is used to return a value to the parent window that opened the child window.
Reminder: A value can also be returned by ..ReturnedValue (<Window Name>..ReturnedValue) run before Close.
The value returned by the child window can be read in the "Closing of a child window" process of the window that opened the child window (the one that called OpenChild): all you have to do is use ..ReturnedValue on the MyChildWindow keyword. The value returned by the child window can be read in the "Closing process of a child window" of the window that opened the child window (the one that called OpenMobileWindow or OpenChild): all you have to do is use ..ReturnedValue on the MyChildWindow keyword.
For example:
  • In the closing code of the child window, Close is used to return a parameter:
    Close("", MyParameter)
  • In the "Closing of a child window" process of the calling window, the name of the child window as well as the returned value can be retrieved by using the MyChildWindow keyword:
    // Close a child window
    NameChildWindow = MyChildWindow..Name
    ValueChildWindow = MyChildWindow..ReturnedValue

Combination of [ALT] and [F4] keys

The combination of [ALT][F4] keys can have 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 the window is run and the window is closed (except if ReturnToCapture is used).
  • 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>)
Components
WINDEVReports and Queries wd230obj.dll
Windows Mobile wp230obj.dll
Java wd230java.jar
Linux wd230obj.so
Android wd230android.jar
Minimum required version
  • 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
May 28 2017