Announcement

Collapse
No announcement yet.

Trying to make simple page but getting 'Expected end of statement' error

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

    Trying to make simple page but getting 'Expected end of statement' error

    Hey guys. I'm trying to make a simple web page that displays the current cool setpoint on my zwave thermostat.

    I'm trying to pull parts from this event script:

    tempdownonedegree.vb
    Code:
    Sub Main(ByVal parms as Object)
    Dim pi As Object 
    Dim oldCoolSetPoint As Double = hs.Plugin("BLStat").GetCoolSetpoint(1,1)
    Dim currentCoolSetPoint As Double
    Dim currentTemperature As Double = hs.Plugin("BLStat").GetTemp(1,1)
    Const failSafe as double = 70
    
    pi = hs.Plugin("BLStat") 
    hs.Plugin("BLStat").DecreaseSetpoint(1,1)
    currentCoolSetPoint = pi.GetCoolSetpoint(1,1)
    hs.writelog("Info", "Setpoint changed from  " & oldCoolSetPoint & "F to " & currentCoolSetPoint & "F")
    
    End Sub
    I'm trying to make an asp file that shows just the current set point using portions of the above code:

    PHP Code:
    <%@ Language=VBScript %> 
    <
    HTML
    <
    head
    </
    head
    <
    BODY
    <% 
    Dim currentCoolSetPoint As Double hs.Plugin("BLStat").GetCoolSetPointTemp(1,1)
    response.Write currentCoolSetPoint
    %>  
    </
    BODY 
    </
    HTML 
    When I open this page in a browser I get this error:

    Script error: Expected end of statement

    Dim currentCoolSetPoint As Double = hs.Plugin("BLStat").GetCoolSetPointTemp(1,1)
    response.Write currentCoolSetPoint
    Maybe I'm just way off. Can someone tell me what I'm doing wrong?
    Last edited by dinki; March 26, 2012, 02:20 PM.

    #2
    in vbscript/asp you do not need to declare in memory the type of the object, indeed I don't think you need to dim it at all in your case (perhaps good practice to do so but not essential). Try;

    HTML Code:
    <%@ Language=VBScript %> 
    <HTML> 
    <head> 
    </head> 
    <BODY> 
    <% 
    response.write hs.Plugin("BLStat").GetCoolSetPointTemp(1,1)
    %>  
    </BODY > 
    </HTML >
    I think the plugin command should be OK but I can't test it not having BLStat

    Comment


      #3
      Thanks for the help. Unfortunately I'm getting this error:

      Script error: Object doesn't support this property or method: 'hs.Plugin(...).GetCoolSetPointTemp'

      response.write hs.Plugin("BLStat").GetCoolSetPointTemp(1,1)

      Comment


        #4
        VBScript does get a little funny about stuff with parameters and the use of brackets, how about

        Dim CPoint
        CPoint = hs.Plugin("BLStat").GetCoolSetPointTemp(1,1)
        response.write CPoint

        Comment


          #5
          I'm getting the same error using the modified code you provided.

          Comment


            #6
            I think Blades plugins don't support a single line function call.

            Try
            Code:
            plug = hs.plugin("BLStat")
            response.write plug.GetCoolSetPointTemp(1,1)
            --
            Jeff Farmer
            HS 3, HSPhone
            My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
            Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

            Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

            Comment


              #7
              Thank you both for the help. Unfortunately I'm still getting errors using CFGuy's code:

              Code:
              Script error: Object required: 'plug'
              
              response.write plug.GetCoolSetPointTemp(1,1)

              Comment


                #8
                Do you still have the plugin enabled? It's a bit odd as this for my Current Cost plugin works which is similar to what you are attempting so I can't see why yours does not.

                HTML Code:
                <html>
                <head>
                </head>
                <body>
                <%
                response.write "<img src=" & hs.plugin("Current Cost (3P)").grLastDay("", 0, "4575B4", "", "") & ">"
                %>
                </body>
                </html>

                Comment


                  #9
                  Yes. It is definitely enabled. I can use the functions from the event scripts just fine.

                  Comment

                  Working...
                  X