Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


9.5.13 GetServiceName (get the service name from a service display name)

Purpose

Gets the service name from the display name of a service.

Syntax
GetServiceName(DispName)
Arguments
DispName

Specify the display name of the service as a character string or as a variable that stores this value.

Description

The GetServiceName command gets the service name from the display name of a specified service. The command returns the service name on successful execution. A zero-length string ("") is returned if an error occurs.

Example
' Halt the service that has the display name "JP1/Script".
svName = GetServiceName("JP1/Script")
If  IsEmpty(svName) = False  Then
  ServiceSetValue("JSService", Name::svName)
  If  IsExistService("JSService")  Then
    ServiceStop("JSService")
  End
End
JP1/Script version

Supported from JP1/Script 05-10.