PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • EndService and EndProgram functions
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
Ends the execution of the current service.
Note: This function only affects the "Service execution (called in loop)" process
Example
// --- Running the service (called in loop)

// Run the service
ServiceExecution()
// Pause during 60 seconds
ServiceWait(6000)

CASE EXCEPTION:
// In case of exception, adds an error into the log of events
ServiceWriteEventLog(ExceptionInfo, elError)
// Stops the service
EndService(esFailure)
Syntax
EndService([<Ending Option>])
<Ending Option>: Optional Integer constant
The options for ending a service are:
esStop
(default value)
The different ending processes are run and the service stops.
esFailureThe different ending processes are not run and the service stops while triggering a failure.
Windows In Windows, the management of failures is performed according to the parameters specified when installing the service. See the Department variable and the ServiceInstall function for more details.
Remarks

EndService and EndProgram functions

In a service:
  • EndService is used to end the execution of the service by performing the following operations:
    • configuring the execution of the ending codes
    • simulating the failure of the service that triggers the failure operations of the OS (automatic restart or restarting the computer for example in Windows).
  • EndProgram can be used with the following specific features:
    • the message is ignored.
    • the ending codes are run (or not) depending on the presence of the boolean in 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 from the application.
  • the ending codes are run (or not) depending on the presence of the ending option.
  • the failure option has no effect.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Linux wd230vm.so
Minimum required version
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment