Announcement

Collapse
No announcement yet.

Script Compile Error :(

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

    Script Compile Error :(

    Hi Guys,

    I am using the code below to come up with temperature differences, and work out the amount of stored energy. It was working great but I must have changed something and now I am getting the:

    Script compile error: End of statement expected.on line 31

    Any chance someone can take a peek and let me know what I am missing. I have had a look at it a few times for missing brackets etc but can't seem to find them

    Thanks!



    PHP Code:
    Imports System.Text.RegularExpressions

    Sub Main
    (parm as object)
    Dim J2 as Double
    Dim J3 
    as Double
    Dim J8 
    as Double

    J2 
    CDbl(replace(hs.DeviceString("j2"),"C",""))
    J3 CDbl(replace(hs.DeviceString("j3"),"C",""))
    J8 CDbl(replace(hs.DeviceString("j8"),"C",""))

    hs.SetDeviceValue("J5", ((J2 J3)*100))
    hs.SetDeviceString("J5", (J2 J3) , True)

    hs.SetDeviceString("J4"4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 " kJ"True)
    hs.SetDeviceValue("J4", *4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 1)

    hs.SetDeviceString("J6",*(4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 1) * 0.94781712) & " BTU"True)
    hs.SetDeviceValue("J6", (4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 1) * 0.94781712)

    hs.SetDeviceString("J8"hs.devicevalue("J7") - (hs.devicevalue("&8")/10) & "C"True)
    hs.SetDeviceValue("J8"hs.devicevalue("J7") - (hs.devicevalue("&8")/10))

    hs.SetDeviceString("J10"hs.devicevalue("J9") * J8 1.43True)
    hs.SetDeviceValue("J10"hs.devicevalue("J9") * J8 1.43)

    End Sub 
    HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

    Facebook | Twitter | Flickr | Google+ | Website | YouTube

    #2
    This line doesn't look right.
    hs.SetDeviceString("J6",*(4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 * 1) * 0.94781712) & " BTU", True)

    You haven't defined just what to multiply by. (underlined)


    Edit:
    Actually, now I see the same thing in the line above this.

    Try...
    hs.SetDeviceValue("J4", 4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 * 1)

    hs.SetDeviceString("J6",(4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 * 1) * 0.94781712) & " BTU", True)
    Last edited by Wadenut; December 23, 2012, 07:56 AM.
    Real courage is not securing your Wi-Fi network.

    Comment


      #3
      I think there is something missing. There are different numbers of left and right parens.

      hs.SetDeviceString("J6",*(4.2 * (J3 - (hs.devicevalue("+10")/10)) * 400 * 1) * 0.94781712) & " BTU", True)
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        Thanks Guys,

        Was that line that ended up being the problem, I commented it out first to test and it worked fine when i commented it out then after replacing it the script worked fine

        Thanks for your help!
        HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

        Facebook | Twitter | Flickr | Google+ | Website | YouTube

        Comment


          #5
          Hint:
          With long scripts it can be difficult to locate "the line" since line numbering isn't exactly accurate..
          In those cases, when I'm stumped, I'll stick in a line I know is going to error out somewhere near where I suspect the problem is. For instance "ErrorHere". Then, when it does error at line x, comparing with the original line number, it makes the problem much easier to find.
          Real courage is not securing your Wi-Fi network.

          Comment


            #6
            Thanks for the tip, that is quite a clever idea to have a reference error line to compare against. I will remember that for other errors I can't locate.

            That is the frustrating thing with the scripting, it is so powerful but the fact that the error line number is not accurate does get frustrating but the reference error line will now get me around that
            HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

            Facebook | Twitter | Flickr | Google+ | Website | YouTube

            Comment


              #7
              Originally posted by travisdh View Post
              Thanks for the tip, that is quite a clever idea to have a reference error line to compare against. I will remember that for other errors I can't locate.

              That is the frustrating thing with the scripting, it is so powerful but the fact that the error line number is not accurate does get frustrating but the reference error line will now get me around that
              I think you take something like 13 (or is it 11?) off of the line number and that gives you the line number in your notepad or whatever. I believe HS's own code is on those 13/11 lines. Still gives you somewhere to aim for...

              Comment


                #8
                Originally posted by mrhappy View Post
                I think you take something like 13 (or is it 11?) off of the line number and that gives you the line number in your notepad or whatever. I believe HS's own code is on those 13/11 lines. Still gives you somewhere to aim for...
                I thought that was the case too, but not always it seems. This one looks like it would have been 16 ?
                Real courage is not securing your Wi-Fi network.

                Comment

                Working...
                X