ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Various properties
  • Exiting a sequence of procedures
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The Before property replaces or inserts a procedure before the other procedures in:
  • a variable of type Procedure.
  • WINDEVWEBDEV - Server codeUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst an event associated with a control.
Example
p is procédure
p = MyProcedure
p.After = MyProcedureCalledAfter
p.Before = MyProcedureCalledBefore
 
// The order for calling the procedures will be:
// - MyProcedureCalledBefore
// - MyProcedure
// - MyProcedureCalledAfter
p()
WindowsLinuxUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst
// Specify the event to run on a click
BTN_BUTTON1.Process[trtClick] = myProcedure1
 
// Add a procedure to run on a click
BTN_BUTTON1.Process[trtClick] += myProcedure2
 
// Add a procedure to run before the click process
BTN_BUTTON1.Process[trtClick].Before += myProcedure3
Syntax

Replacing existing procedures with the Before property (= operator) Hide the details

<Element>.Before = <WLanguage procedure>
<Element>: Character string
Element to use:
  • Name of a variable of type Procedure.
  • WindowsLinuxUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst Event of a control. The events of a control can be handled with the Process property.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure that will replace the existing procedures.

Inserting a procedure before the existing procedures (+= operator) Hide the details

<Element>.Before += <WLanguage procedure>
<Element>: Character string
Element to use:
  • Name of a variable of type Procedure.
  • WindowsLinuxUniversal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst Event of a control. The events of a control can be handled with the Process property.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure to be inserted before the current procedure.
Remarks

Exiting a sequence of procedures

If several procedures are executed in a sequence, this sequence can be interrupted from the code of one of the procedures using SetFocusAndReturnToUserInput.
Example:
// Click on BTN_Button1
BTN_Button2.Process[trtClick].Before += MyProc1
BTN_Button2.Process[trtClick].Before += MyProc2
// Click on BTN_Button2
Trace("Button 2 clicked")
PROCEDURE MyProc1()
Trace(dbgInfo(dbgProcess))
SetFocusAndReturnToUserInput(MySelf.Name)
PROCEDURE MyProc2()
Trace(dbgInfo(dbgProcess))
Minimum version required
  • Version 19
This page is also available for…
Comments
About versions prior to 27
When using the Process property on a control, you must use 2 dots before the BEFORE

BTN_test.Process[trtClick]..before = myProc1
BTN_test.Process[trtClick]..before += myProc2

Otherwise, the compiler complains that your procedure should return a value.
CCordes
04 Aug. 2022

Last update: 11/03/2022

Send a report | Local help