Announcement

Collapse
No announcement yet.

runScriptFunc - not returing anything?

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

  • widert
    replied
    Originally posted by jon00 View Post
    You need to set the 4th parameter for the RunscriptFunc to TRUE, otherwise it will not wait for a response from your function i.e.

    test = hs.RunScriptFunc("funksjoner.vb","Test","",TRUE,FALSE)
    Yes, that solved it.

    Thank you so much!

    Leave a comment:


  • jon00
    replied
    You need to set the 4th parameter for the RunscriptFunc to TRUE, otherwise it will not wait for a response from your function i.e.

    test = hs.RunScriptFunc("funksjoner.vb","Test","",TRUE,FALSE)

    Leave a comment:


  • widert
    replied
    Originally posted by aa6vh View Post
    Try changing your writelog statement to:
    hs.WriteLog ("Info", test.ToString())
    That throws an exception:
    Exception has been thrown by the target of an invocation.Object reference not set to an instance of an object
    Public Function Test(parms As Object) As String
    Did not help, still result is blank...

    Leave a comment:


  • aa6vh
    replied
    Try changing your writelog statement to:
    hs.WriteLog ("Info", test.ToString())

    You could also just change your function declare to

    Public Function Test(parms As Object) As String

    Leave a comment:


  • widert
    replied
    Originally posted by tenholde View Post
    change
    Test = "Hey there" to Return "Hey there"
    Thanks, but unfortunately, still not working. Nothing is returned from the function.

    Leave a comment:


  • tenholde
    replied
    change
    Test = "Hey there" to Return "Hey there"

    Leave a comment:


  • widert
    started a topic runScriptFunc - not returing anything?

    runScriptFunc - not returing anything?

    I am running the following code (Ubuntu):

    Code:
    Sub Main(ByVal Parms As Object)
      Dim test As String
      test = hs.RunScriptFunc("funksjoner.vb","Test","",FALSE,FALSE)
      hs.WriteLog ("Info", test)  
    End Sub
    my funksjoner.vb file looks like this:
    Code:
    Public Function Test(parms As Object) As Object
      Test = "Hey there"
    End Function
    But I do not get anything back, from the logfile:
    Code:
     
    Sep-02 9:33:00 PM Info
    Sep-02 9:32:59 PM Event Running script in background: /usr/local/HomeSeer/scripts/test.vb
    Any suggestions on what I'm doing wrong?

    Regards
    Tom
Working...
X