PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

This content has been translated automatically. Click here to view the French version.
  • Execute the event associated with a field or an Procedure of a window (or page) different from the current window (or page)
  • String passed as a parameter to the Execute function
  • The arrays
  • Open window/page
  • Calling a global component procedure
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
Starts the execution of a process by programming. This function is mainly used to run procedures.
For backward compatibility, the process run can also be the process of a control, window or page. In these different cases, we recommend that you use ExecuteProcess.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for 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
// Exécution d'une procédure
Exécute("Proced1")
// -- Clic sur le bouton BTN_BOUTON1
// Exécution d'une procédure retournant un résultat
Info(Exécute("Doubler_Nombre", 2)) // Affiche 4
// Procédure Doubler_Nombre
PROCÉDURE Doubler_Nombre(X)
RETURN 2*X
Syntax
Universal Windows 10 AppWindows MobileiPhone/iPadApple WatchUser code (UMC)PHPAjax

Running a procedure that may return a result Hide the details

<Result> = Execute(<WLanguage procedure> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Any
Return value of procedure called. This value is identical to the value obtained if the procedure is run directly.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure to run. This procedure returns a result.
<Parameter 1>: Any optional type
First optional parameter that will be passed to the procedure. These parameters are always passed by value.
<Parameter N>: Any optional type
Nth optional parameter that will be passed to the procedure. These parameters are always passed by value.

Running the process of a control (syntax kept for backward compatibility) Hide the details

Execute(<Control name> , <Process>)
<Control name>: Character string (without quotes)
Name of control associated with the process to run.
<Process>: Character string (without quotes)
Process to run:
ClickClick code of control (or menu option)
ExitExit code of control
PHP This constant is not available.
EntryEntry code of control
PHP This constant is not available.
InitializationInitialization code of control
PreviousCode used to read the previous record (browsing table in programmed browse only)

PHP This constant is not available.
NextCode used to read the next record (browsing table in programmed browse only)

PHP This constant is not available.
DisplayCode used to display a row (table only)
PHP This constant is not available.
RExitCode used to exit from a table row
PHP This constant is not available.
REntryCode used to enter in a table row
PHP This constant is not available.
ENDCode used to read the last record (table only)
PHP This constant is not available.
ModifyWhenever Modified code of control
PHP This constant is not available.
DBLCode for double-clicking a treeview element
PHP This constant is not available.
CLDCode for right-clicking a treeview element
PHP This constant is not available.
CLIClick (OnClick) (browser code)
WINDEV Mobile This constant is not available.
KDNKey down (OnKeyDown) (browser code)
WINDEV Mobile This constant is not available.
KPRKey pressed and released (OnKeyPressed) (browser code)
WINDEV Mobile This constant is not available.
KUPKey up (OnKeyUp) (browser code)
WINDEV Mobile This constant is not available.
MDNMouse button down (OnMouseDown) (browser code)
WINDEV Mobile This constant is not available.
MMVMouse moves over the control (OnMouseMove) (browser code)
WINDEV Mobile This constant is not available.
MOUMouse exits from the control (OnMouseOut) (browser code)
WINDEV Mobile This constant is not available.
MOVMouse enters in the control (OnMouseOver) (browser code)
WINDEV Mobile This constant is not available.
MUPMouse button up (OnMouseUp) (browser code)
WINDEV Mobile This constant is not available.
BLULoss of focus (OnBlur) (browser code)
WINDEV Mobile This constant is not available.
CHGModification (OnChange) (browser code)
WINDEV Mobile This constant is not available.
FOCGain of focus (OnFocus) (browser code)
WINDEV Mobile This constant is not available.
SELSelected text (OnSelect) (browser code)
WINDEV Mobile This constant is not available.
HLPF1 key (OnHelp) (browser code)
WINDEV Mobile This constant is not available.
Universal Windows 10 AppWindows MobileiPhone/iPadApple WatchUser code (UMC)

Running the process of a window (syntax kept for backward compatibility) Hide the details

Execute([<Window name>, ] <Type of process>)
<Window name>: Optional character string (without quotes)
Name of the window whose process must be run. If this name is not specified, the process of current window is run.
<Type of process>: Character string (without quotes)
Process to run:
INFOpening the window
FEFClosing the window
PRFThe window takes focus
PEFThe window loses focus
MODResizing the window
PHPAjax

Running the process of a page (syntax kept for backward compatibility) Hide the details

Execute(<Page name> , <Type of process>)
<Page name>: Character string (without quotes)
Name of the page whose process must be run. If this name is not specified, the process of the current page is run.
<Type of process>: Character string (without quotes)
Process to run:
INFOpening the page
FEFClosing the page
PHP This constant is not available.
PRFThe page takes focus
PHP This constant is not available.
PEFThe page loses focus
PHP This constant is not available.
MODResizing the page
PHP This constant is not available.
CLIClick (OnClick)
PHP This constant is not available.
DBLDouble click (OnDblClick)
PHP This constant is not available.
KDNKey down (OnKeyDown)
PHP This constant is not available.
KPRKey pressed and released (OnKeyPressed)
PHP This constant is not available.
KUPKey up (OnKeyUp)
PHP This constant is not available.
MDNMouse button down (OnMouseDown)
PHP This constant is not available.
MMVMouse moves over the control (OnMouseMove)
PHP This constant is not available.
MOUMouse exits from the control (OnMouseOut)
PHP This constant is not available.
MOVMouse enters in the control (OnMouseOver)
PHP This constant is not available.
MUPMouse button up (OnMouseUp)
PHP This constant is not available.
BLULoss of focus (OnBlur)
PHP This constant is not available.
CHGModification (OnChange)
PHP This constant is not available.
FOCGain of focus (OnFocus)
PHP This constant is not available.
SELSelected text (OnSelect)
PHP This constant is not available.
HLPF1 key (OnHelp)
PHP This constant is not available.
LODLoading the page (OnLoad)
PHP This constant is not available.
UNLUnloading the page (OnUnload)
PHP This constant is not available.
RESReinitializing the page (OnReset)
PHP This constant is not available.
SUBValidating the page (OnSubmit)
PHP This constant is not available.
Remarks
Universal Windows 10 AppWindows MobileiPhone/iPadApple WatchUser code (UMC)Ajax

Execute the event associated with a field or an Procedure of a window (or page) different from the current window (or page)

It is possible to execute the event associated with a field or an Procedure of a window (or page) different from the current window (or page). To do so, the control name or the procedure name must be prefixed with the name of the window (or page).
For example:
// Exécuter l'événement "Clic" du bouton Valider de MaSoeur (fenêtre ou page ouverte)
Exécute("MaSoeur.Valider..CLI")
 
// Exécuter la procédure PROC1 de MaSoeur (fenêtre ou page ouverte)
Exécute("MaSoeur.PROC1")
Universal Windows 10 AppWindows MobileiPhone/iPadApple WatchUser code (UMC)

String passed as a parameter to the Execute function

The string passed in parameter to Execute cannot be a built string or a variable. It is necessary to use directly the string containing the name of the control, the window or the page and the treatment/event to be executed.
// Code correct
Exécute("Saisie2..Sortie")
 
// Code incorrect
i is int = 5
Exécute("Saisie" + i + "..Sortie")
Universal Windows 10 AppWindows MobileiPhone/iPadApple WatchUser code (UMC)Ajax

The arrays

The arrays are not recognized by Execute.
For example:
var_tab is array of 10 strings
// Appel une procédure MAPROC avec un tableau passé en paramètre
MAPROC(var_tab)
// L'instruction suivante provoque une erreur
Exécute("MAPROC..PRO", var_tab)
Windows MobileiPhone/iPadApple WatchUser code (UMC)PHPAjax

Open window/page

The Execute function should not be called to execute the WLanguage event to open a window/page because the global variables may be reset. Procedures must be used in this case.
Windows MobileUser code (UMC)Ajax

Calling a global component procedure

Execute is used to call a global component procedure. To do so, use the following syntax:
Exécute(<Nom Composant>.<Nom Collection de procédures>.<Nom Procédure>)
Example:
Exécute("MonComposant.Collection_WDExemple.MaProcédure")
In a thread started by a component, Execute cannot be used to call a local procedure of a window of the host project.
You must use a global procedure of the host project to call the local procedure of the window.
Component: wd260vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
exemplo compile e execute
https://windevdesenvolvimento.blogspot.com/2021/05/dicas-3340-windev-webdev-mobile-compile.html
https://youtu.be/fSx8ybbBZws

//initializing - pode ser colocado no global caso precisar
CONSTANT
// Nome do procedimento que é compilado dinamicamente
DYNAMIC_PROCEDURE = "DYNAMIC_PROCEDURE"
END

// BOTAO CALCULA - ACIONAR O AJAX
EDT_resultado_compilacao=Compile(dynamic_procedure,EDT_comandos)
IF EDT_resultado_compilacao="" THEN
Execute(dynamic_procedure)
EDT_resultado_compilacao="Compilado corretamente"
ELSE
EDT_resultado_compilacao="Erro"+ErrorInfo(errFullDetails)
END
amarildo
01 Jun. 2021