Hi,
I need to split my device name in a script, the device name is Dryer Status.
I simply need to take the 'Dryer' part into a variable.
So far, I am passing a device's ref ID as a parameter.
The script takes that parameter and looks up the current status of the device for use in the script later on and also looks up the device name from the same parameter.
I need to split it rather than rename my devices. Currently, 'DeviceName holds the name of the device but I don't know how to split the first word using space as the delimiter.
Public Sub Main(ByVal Parms As String)
Dim DeviceStatus As String
Dim DeviceName As String
Dim Device As Scheduler.Classes.DeviceClass
DeviceStatus = hs.CAPIGetStatus(Parms).Status()
Device = hs.GetDeviceByRef(Parms)
DeviceName = Device.name(hs)
Any help appreciated.
I need to split my device name in a script, the device name is Dryer Status.
I simply need to take the 'Dryer' part into a variable.
So far, I am passing a device's ref ID as a parameter.
The script takes that parameter and looks up the current status of the device for use in the script later on and also looks up the device name from the same parameter.
I need to split it rather than rename my devices. Currently, 'DeviceName holds the name of the device but I don't know how to split the first word using space as the delimiter.
Public Sub Main(ByVal Parms As String)
Dim DeviceStatus As String
Dim DeviceName As String
Dim Device As Scheduler.Classes.DeviceClass
DeviceStatus = hs.CAPIGetStatus(Parms).Status()
Device = hs.GetDeviceByRef(Parms)
DeviceName = Device.name(hs)
Any help appreciated.
Comment