Announcement

Collapse
No announcement yet.

Wend Statment

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

    Wend Statment

    Okay I'm am confused... I tried everything I know (which is not much!) but I keep getting this error!

    Script error: Expected 'Wend'While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))

    Here is my code:

    <%@LANGUAGE=VBScript %>
    <!--#include file="Connections/HALIE.asp" -->
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_HALIE_STRING
    Recordset1.Source = "SELECT * FROM automation.door_log"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = 10
    Repeat1__index = 0
    Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>

    <body>
    <table border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td>Key</td>
    <td>Location</td>
    <td>ZoneNumber</td>
    <td>Status</td>
    <td>Date</td>
    </tr>
    <% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
    <tr>
    <td><%=(Recordset1.Fields.Item("Key").Value)%>&l t;/td>
    <td><%=(Recordset1.Fields.Item("Location").Value)%& gt;</td>
    <td><%=(Recordset1.Fields.Item("ZoneNumber").Value) %></td>
    <td><%=(Recordset1.Fields.Item("Status").Value)%&gt ;</td>
    <td><%=(Recordset1.Fields.Item("Date").Value)%>& lt;/td>
    </tr>
    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    Recordset1.MoveNext()
    Wend
    %>
    </table>
    </body>
    </html>
    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>


    Cand I ge some help from the PROS!!!

    Thanks in advance

    -Sean

    #2
    Sean,
    I'm assuming your running this using the HS web server. If so try putting everything in one set of asp blocks like:
    <pre class="ip-ubbcode-code-pre">
    &lt;%
    While ((Repeat1__numRows &lt;&gt; 0) AND (NOT Recordset1.EOF))
    response.write"&lt;tr&gt;"
    response.write"&lt;td&gt;" & Recordset1.Fields.Item("Key").Value) & "&lt;/td&gt;"
    response.write"&lt;td&gt;" & Recordset1.Fields.Item("Location").Value & "&lt;/td&gt;"
    response.write"&lt;td&gt;" & Recordset1.Fields.Item("ZoneNumber").Value & "&lt;/td&gt;"
    response.write"&lt;td&gt;" & Recordset1.Fields.Item("Status").Value & "&lt;/td&gt;"
    response.write"&lt;td&gt;" & Recordset1.Fields.Item("Date").Value & "&lt;/td&gt;"
    response.write"&lt;/tr&gt;"
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    Recordset1.MoveNext()
    Wend
    %&gt;
    </pre>

    This is untested code but you should get the idea.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Thanks Rupp! Your suggestion guided me in the right direction. I tried the way you suggested and it worked. This still puzzles me, it this a homeseer thing or a standard?

      Comment


        #4
        It's a HomeSeer thang. Glad you got it working.
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment

        Working...
        X