Announcement

Collapse
No announcement yet.

Hs.writeLog command errors

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

  • rjh
    replied
    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:	140
Size:	33.2 KB
ID:	1475157

    Click image for larger version

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

    Roger D

    Leave a comment:


  • rjh
    replied
    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?

    Leave a comment:


  • alexbk66
    replied
    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?

    Leave a comment:


  • Roger D
    replied
    Forgot to ask...

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

    Thanks,

    Roger D

    Leave a comment:


  • Roger D
    replied
    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:	140
Size:	33.2 KB
ID:	1475157

    Click image for larger version

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

    Roger D

    Leave a comment:


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

    Leave a comment:


  • rjh
    replied
    $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


    Leave a comment:


  • jon00
    replied
    Originally posted by rjh View Post
    If we change this now we can break plugins that are using this API. So something will need to remain broken. For Immediate scripts you can use HS.WriteLogEx.
    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



    Leave a comment:


  • rjh
    replied
    If we change this now we can break plugins that are using this API. So something will need to remain broken. For Immediate scripts you can use HS.WriteLogEx.

    Originally posted by jon00 View Post

    This is an issue with an immediate script command:

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

    Leave a comment:


  • jon00
    replied
    Originally posted by rjh View Post
    Looks like you are using vbscript. That is really old and will probably start to break going forward, change your script to .vb script and use the vb.net syntax or use the WriteLogEx function instead. I believe WriteLog has an issue because there are multiple definitions and vbscript does not support that.
    This is an issue with an immediate script command:

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

    Leave a comment:


  • rjh
    replied
    Looks like you are using vbscript. That is really old and will probably start to break going forward, change your script to .vb script and use the vb.net syntax or use the WriteLogEx function instead. I believe WriteLog has an issue because there are multiple definitions and vbscript does not support that.

    Leave a comment:


  • jon00
    replied
    Originally posted by Roger D View Post
    Greetings All,

    I'm confused, is this not supposed to work in HS4?

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

    Thanks,

    Roger D
    Yes it is but continues to be a longstanding bug in HS4.

    You currently have to use:

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

    rjh Rich, any idea when this will be fixed?

    Leave a comment:


  • Roger D
    replied
    Greetings All,

    I'm confused, is this not supposed to work in HS4?

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

    Thanks,

    Roger D

    Leave a comment:


  • peterpc
    replied
    No, still running HS3....

    Leave a comment:


  • avpman
    replied
    Originally posted by peterpc View Post
    I reported it today to Homeseer Help Center.
    Error keeps me from changing to HS4....
    Hi. Any update from HS? Thanks!

    Leave a comment:

Working...
X