Announcement

Collapse
No announcement yet.

Passing multiple parameter to .vb from HStouch

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

  • ksum
    replied
    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.

    Leave a comment:


  • mfisher
    replied
    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

    Leave a comment:


  • ksum
    started a topic Passing multiple parameter to .vb from HStouch

    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?
Working...
X