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

  • dinki
    replied
    Yes. It is definitely enabled. I can use the functions from the event scripts just fine.

    Leave a comment:


  • mrhappy
    replied
    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>

    Leave a comment:


  • dinki
    replied
    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)

    Leave a comment:


  • CFGuy
    replied
    I think Blades plugins don't support a single line function call.

    Try
    Code:
    plug = hs.plugin("BLStat")
    response.write plug.GetCoolSetPointTemp(1,1)

    Leave a comment:


  • dinki
    replied
    I'm getting the same error using the modified code you provided.

    Leave a comment:


  • mrhappy
    replied
    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

    Leave a comment:


  • dinki
    replied
    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)

    Leave a comment:


  • mrhappy
    replied
    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

    Leave a comment:


  • 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 26th, 2012, 02:20 PM.
Working...
X