PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

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
ServiceWaitStatus (Function)
In French: ServiceAttendEtat
Waits for a service to be in a specific status. This service can be found on the local computer or on a remote computer.
// Waits for the service found in TABLE_Service to be started
Res is int
ServiceStart(COL_Name[TABLE_Service])
Res = ServiceWaitStatus(COL_Name[TABLE_Service], serviceStatusStarted, 10)
IF Res = -1 THEN
Error(ErrorInfo())
ELSE
Info("Status at the end of time-out: " + StatusInText(Res))
END
Syntax
<Result> = ServiceWaitStatus(<Service Name> , <Expected Status> [, <Time-out> [, <Remote Computer>]])
<Result>: Integer constant
  • Current status of the service,
    serviceStatusStoppedThe service is stopped.
    serviceStatusStoppingThe service received a command to stop but it has not been stopped yet.
    serviceStatusStartingThe service received a command to start but it has not been started yet.
    serviceStatusPausingThe service received a command to pause but it has not been paused yet.
    serviceStatusRestartingThe service received a command to restart but it has not been restarted yet.
    serviceStatusStartedThe service is currently operating.
    serviceStatusPausedThe service is paused.
    serviceStatusTimeoutThe service has not reached the requested status at the end of time-out.
  • -1 if an error occurred. To find out the error details, use ErrorInfo.
<Service Name>: Character string (with quotes)
Name of the service to use.
<Expected Status>: Integer constant
Expected status of the service:
serviceStatusStoppedThe service is stopped.
serviceStatusStoppingThe service received a command to stop but it has not been stopped yet.
serviceStatusStartingThe service received a command to start but it has not been started yet.
serviceStatusPausingThe service received a command to pause but it has not been paused yet.
serviceStatusRestartingThe service received a command to restart but it has not been restarted yet.
serviceStatusStartedThe service is currently operating.
serviceStatusPausedThe service is paused.
<Time-out>: Optional integer or optional Duration
Maximum time-out (in seconds). This parameter can correspond to:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s for example).
    New in version 23
    the direct indication of duration (1 s for example).
    the direct indication of duration (1 s for example).
If this parameter is not specified, the time-out is set to 10 seconds.
<Remote Computer>: Optional character string (with quotes)
  • IP address of the remote computer in xxx.xxx.xxx.xxx format (returned by NetIPAddress),
  • Name of the remote computer (returned by NetMachineName).
This parameter is used to handle a service on another computer. To use this option, the user must be administrator of the remote computer.
If this parameter is not specified or if it corresponds to an empty string (""), the service is handled locally.
Remarks
The functions for service management do not operate in the following operating systems: Windows 98 or Me.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Linux wd230std.so
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment