Forums

ASP

This topic is locked

if statement in repeat region

Posted 21 Sep 2005 00:12:24
1
has voted
21 Sep 2005 00:12:24 Matthijs de Groot posted:
What do I wrong:

<pre id=code><font face=courier size=2 id=code>
&lt;%
While ((Repeat2__numRows &lt;&gt; 0) AND (NOT rs_formitem.EOF))
%&gt;
&lt;tr&gt;
&lt;td&gt;&lt;%=(rs_formitem.Fields.Item("name".Value)%&gt; - &lt;%=(rs_formitem.Fields.Item("formid1".Value)%&gt;&lt;/td&gt;
&lt;td&gt;&lt;% if (rs_formitem.Fields.Item("type".Value) = "textfield" then %&gt;
&lt;input name="&lt;%=(rs_formitem.Fields.Item("elementname".Value)%&gt;" type="textfield"&gt;
&lt;% else if (rs_formitem.Fields.Item("type".Value) = "textbox" then %&gt;
&lt;textarea name="&lt;%=(rs_formitem.Fields.Item("elementname".Value)%&gt;"&gt;&lt;/textarea&gt;&lt;% end if %&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rs_formitem.MoveNext()
Wend
%&gt;
</font id=code></pre id=code>

I receive the following error:

<pre id=code><font face=courier size=2 id=code>
Microsoft VBScript compilation error '800a0400'

Expected statement

/file.asp, line 259

Wend
^

</font id=code></pre id=code>

Hope anyone can help me

Replies

Replied 21 Sep 2005 00:33:49
21 Sep 2005 00:33:49 Matthijs de Groot replied:
Found the solution...

<pre id=code><font face=courier size=2 id=code> &lt;%
While ((Repeat2__numRows &lt;&gt; 0) AND (NOT rs_formitem.EOF))
%&gt;
&lt;tr&gt;
&lt;td&gt;&lt;%=(rs_formitem.Fields.Item("name".Value)%&gt; - &lt;%=(rs_formitem.Fields.Item("formid1".Value)%&gt;&lt;/td&gt;
&lt;% Dim tipe
tipe = rs_formitem.Fields.Item("type".Value
if tipe = "textfield" then %&gt;
&lt;td&gt;&lt;input name="&lt;%=(rs_formitem.Fields.Item("elementname".Value)%&gt;" type="textfield"&gt;&lt;/td&gt;
&lt;% else if tipe = "textbox" then %&gt;
&lt;td&gt;&lt;textarea name="&lt;%=(rs_formitem.Fields.Item("elementname".Value)%&gt;"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;% end if %&gt;
&lt;% end if%&gt;
&lt;/tr&gt;
&lt;%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rs_formitem.MoveNext()
Wend
%&gt;</font id=code></pre id=code>

Reply to this topic