Announcement

Collapse
No announcement yet.

Passing multiple parameter to .vb from HStouch

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Passing multiple parameter to .vb from HStouch

    I have a script, currently real simple:
    Code:
    Sub Main(ByVal Parms() As Object)
      hs.writelog("Parameter Test",Parms(0))
      hs.writelog("Parameter Test",Parms(1))
    End Sub
    and I want to send 2 parameters from HStouch which are not based on an element. In the Action Editor, I set it to run a script and set the script to be:
    Code:
    &hs.runScriptFunc("IncrementTime.vb","Main",{"Turn Module On",30,False,False)
    I keep getting init error: Invalid character

    I believe my problem is how I am trying to pass 2 parameters. Any suggestions on where I am going wrong?
    Karl S
    HS4Pro on Windows 10
    242 Devices
    56 Z-Wave Nodes
    37 Events
    HSTouch Clients: 3 Android, 1 iOS
    Google Home: 3 Mini units 1 display

    #2
    I don't believe you can pass an array from an immediate script command. FYI, there's a typo in your immediate function: ] instead of } to close your array definition, it should read as follows:
    Code:
    &hs.runScriptFunc("IncrementTime.vb","Main",{"Turn Module On",30,False,False})
    You can instead pass multiple values in a comma (or other character) delimited string:
    Code:
    &hs.runScriptFunc("IncrementTime.vb","Main","Turn Module On,30,False,False")
    And change your code to:
    Code:
    Sub Main(ByVal Parms As Object)
      Dim sTemp As String() = Split(Parms,",")
      hs.writelog("Parameter Test", sTemp(0))
      hs.writelog("Parameter Test", sTemp(1))
    End Sub
    Best regards,
    -Mark-

    If you're not out on the edge, you're taking up too much room!
    Interested in 3D maps? Check out my company site: Solid Terrain Modeling

    Comment


      #3
      I had to change it to
      Code:
      &hs.runScriptFunc("IncrementTime.vb","Main","Turn Module On,30",False,False)
      as the False, False are not part of the passed parameters. Otherwise this seems to work. Thank you. I did try a lot of different variations as well with no success.
      Karl S
      HS4Pro on Windows 10
      242 Devices
      56 Z-Wave Nodes
      37 Events
      HSTouch Clients: 3 Android, 1 iOS
      Google Home: 3 Mini units 1 display

      Comment

      Working...
      X