Announcement

Collapse
No announcement yet.

Help Passing Parameters

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

    Help Passing Parameters

    Hello


    This is my function:
    Sub speakSomething(speakername As String, volume As Integer, tts As String)


    I have an event which runs a script:
    Sub or Function: speakSomething
    Parameters: livingroom,40,testing

    I have used no ' or " in the white boxes. I have tried though.



    I then get this error:

    Running script C:\Program Files (x86)\HomeSeer HS3\scripts\sonos.vb :Parameter count mismatch.->Does entry point speakSomething exist in script? at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Obj ect obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at A.c17b105f989efe61e5979e67bec1ef734.cffd66cb0782c50126727e3f a75582d7a()

    Running script and waiting: C:/Program Files (x86)/HomeSeer HS3/scripts/sonos.vb("speakSomething","livingroom,40,testing")

    Please can you tell me what I am doing wrong?

    #2
    You can only pass a single parameter to a script from an event.

    As you have it, you can change your sub to:

    Sub speakSomething(ByVal Data As String)

    Then Split Data to the 3 variables:

    Dim Result() As String = Data.Split(",")
    Dim speakername As String = Result(0)
    Dim Volume As String = Result(1)
    Dim tts As String = Result(2)
    Jon

    Comment


      #3
      Thank you

      Comment


        #4
        I would recommend using something other than "," for delimiter. Something like vertical bar "|"

        tenholde
        tenholde

        Comment

        Working...
        X