ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
  • EndService and EndProgram functions
  • Function EndProgram in a dynamic WEBDEV site
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Ends the execution of the current program.
WINDEV All the windows are closed and no code is run.
iPhone/iPadIOS WidgetApple WatchMac Catalyst This function should only be used for debugging as the license of this type of hardware does not allow closing the application.
Example
WINDEVReports and QueriesJavaUser code (UMC)
// Vérification du mot de passe
IF MotDePasse <> "Rantanplan" THEN
	EndProgram("Mot de passe incorrect")
END
WEBDEV - Server codePHPAjax
// Vérification du mot de passe
IF MotDePasse <> "Rantanplan" THEN
	PageDisplay(PAGE_Fin)
	EndProgram()
END
Syntax
EndProgram([<Line 1> [... [, <Line N> [, <Closing code>]]]])
<Line 1>: Optional character string
Lines of the message to display when the program is ended. This message is displayed in an "Error" dialog box.
<Line N>: Optional character string
Lines of the message to display when the program is ended. This message is displayed in an "Error" dialog box.
<Closing code>: Optional boolean
  • False (default value) if the project closing code is not run.
  • True if the project closing code is run.
Remarks

EndService and EndProgram functions

In a service:
  • EndService ends the execution of the service by performing the following operations:
    • configuring the execution of the closing codes
    • simulating a service failure, which triggers OS failure recovery actions (automatic restart, or reboot in Windows, for example).
  • EndProgram can be used with the following specific features:
    • the message is ignored.
    • closing codes are run (or not) depending on the boolean specified as the last parameter.
    • the service ends normally and no failure is simulated.
In an application, EndService can be used with the following specific features:
  • no message is displayed when exiting the application.
  • closing codes are run (or not) depending on the specified closing option.
  • the failure option has no effect.

Function EndProgram in a dynamic WEBDEV site

In a dynamic site, the EndProgram function terminates the session on the server and releases the resources..
When it is called, it is advisable to display a new static page in place of the current one.. If this were not the case, the surfer could call up server processing of the page displayed in the browser: this processing could not be executed, as the corresponding session no longer existed..
The most commonly used solution is as follows:
  1. Create a "Logout" button field.
  2. In the control description window, specify whether the button should be of the "Automatic detection of server and browser codes to be executed" or "Always execute server and browser codes" type.
  3. In the "Click browser" event of the Button field, use the PageDisplay function to display a static page of the site..
    If required, the static page can be used to launch a new session, by calling the DynamicSiteDisplay function.
  4. In the "Click on (server)" event, use function EndProgram.
Related Examples:
WD Magnifier Complete examples (WINDEV): WD Magnifier
[ + ] This example enables you to zoom part of the screen with a magnifier.
The maximum zoom value is set to 8.
Summary of the example supplied with WINDEV:
The WLanguge function named dCopyBlt() and the WLanguage property named ..Opacity allow you to perform a capture of the Windows desktop at the location of a window without this window appearing in the screen shot.
This example uses this tip to zoom the part of the screen found below the magnifier.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help