Announcement

Collapse
No announcement yet.

Hs.writeLog command errors

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

    #31
    $n works because its using the vb.net engine to run the script which supports overloaded functions. The other syntax causes the old vbscript COM engine to be used. We overloaded the writelog function and I suspect the developer who did that did not realize the limitations of vbscript. The only fix is to remove the overloaded function which might break other scripts or plugins that also use that API.

    Yes, I can add a note to the docs. We are in the process or moving all the scripting docs to a new format.

    Originally posted by jon00 View Post

    Rich,

    I don't wish to be a pain, but would you please elaborate on this? Which API are you referring to? If this is going to be the case, should not this be documented somewhere?

    Just for your information, the following works in an immediate script command:

    &nhs.Writelog ("WriteLog Entry", "Insert message here")

    This fails:

    &hs.Writelog ("WriteLog Entry", "Insert message here")

    Running script(1) &hs.Writelog ("WriteLog Entry", "Insert message here"), init error: Cannot use parentheses when calling a Sub

    As does:

    &hs.Writelog "WriteLog Entry", "Insert message here"

    Running script(2) &hs.writelog WriteLog Entry, Insert message here, init error: Syntax error


    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #32
      Originally posted by rjh View Post
      $n works because its using the vb.net engine to run the script which supports overloaded functions. The other syntax causes the old vbscript COM engine to be used. We overloaded the writelog function and I suspect the developer who did that did not realize the limitations of vbscript. The only fix is to remove the overloaded function which might break other scripts or plugins that also use that API.

      Yes, I can add a note to the docs. We are in the process or moving all the scripting docs to a new format.
      Ok, fully understand the issue. One option may be to try $nhs on &hs error; however it is probably easier to say that implement.
      Jon

      Comment


        #33
        I'm still confused because this works on my RPi HS4 4.1.16.0 system.


        Click image for larger version

Name:	Screenshot from 2021-05-18 20-10-03.png
Views:	254
Size:	33.2 KB
ID:	1475157

        Click image for larger version

Name:	Screenshot from 2021-05-18 20-12-21.png
Views:	243
Size:	94.2 KB
ID:	1475158

        Roger D

        Comment


          #34
          Forgot to ask...

          What does the "n" in &nhs. do?

          Thanks,

          Roger D

          Comment


            #35
            Originally posted by Roger D View Post
            Forgot to ask... What does the "n" in &nhs. do?
            These prefixes tell what script engine to use, i.e. default VB, VB.NET ('n') or C# ('s' or 'c' - can't remember).
            Took me awhile to work out, just wondering if it's documented somewhere rjh spud?

            Comment


              #36
              Documented here:

              https://docs.homeseer.com/display/HS...ipt+Statements

              Originally posted by alexbk66 View Post

              These prefixes tell what script engine to use, i.e. default VB, VB.NT ('n') or C# ('s' or 'c' - can't remember).
              Took me awhile to work out, just wondering if it's documented somewhere rjh spud?
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #37
                The PI (and Linux in general) does not support VBScript, you only have vb.net scripting, so not an issue on those systems.

                Originally posted by Roger D View Post
                I'm still confused because this works on my RPi HS4 4.1.16.0 system.


                Click image for larger version

Name:	Screenshot from 2021-05-18 20-10-03.png
Views:	254
Size:	33.2 KB
ID:	1475157

                Click image for larger version

Name:	Screenshot from 2021-05-18 20-12-21.png
Views:	243
Size:	94.2 KB
ID:	1475158

                Roger D
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment

                Working...
                X