PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Example: waiting for the status of a service
ServiceWaitStatus (Example)
Example: waiting for the status of a service
// Waits for the service found in TABLE_Service to be started
Res is int
Res = ServiceWaitStatus(COL_Name[TABLE_Service], "", serviceStatusStarted, 10)
IF Res = -1 THEN
Error(ErrorInfo())
ELSE
Info("Status at the end of timeout: " + StatusInText(Res)
END

FUNCTION StatusInText(plStatus)
lsResult is string
SWITCH plStatus
CASE serviceStatusStopped: lsResult = "serviceStatusStopped"
CASE serviceStatusStopping: lsResult = "serviceStatusStopping"
CASE serviceStatusStarting: lsResult = "serviceStatusStarting"
CASE serviceStatusPausing: lsResult = "serviceStatusPausing"
CASE serviceStatusRestarting: lsResult = "serviceStatusRestarting"
CASE serviceStatusStarted: lsResult = "serviceStatusStarted"
CASE serviceStatusPaused: lsResult = "serviceStatusPaused"
CASE serviceStatusTimeout: lsResult = "serviceStatusTimeout"
OTHER CASE:
END
RESULT lsResult
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment