Forums

ASP

This topic is locked

IF...THEN...ELSE syntax problem

Posted 27 Aug 2006 02:21:55
1
has voted
27 Aug 2006 02:21:55 Wim Conix posted:
Hello,

Can someone help me with this ?
I want a different fontcolor for a quite simple IF...THEN...ELSE result.
However, with code below I'm getting error :

"Compilation error Microsoft VBScript error '800a03fa'
'Wend' expected"

Code I use :

<font color="#AAAAAA" size="2" face="Arial, Helvetica, sans-serif"><%IF (Recordset3.Fields.Item("Count".Value) = 0 THEN Response.Write "registered"%></font><font color="#CCCCCC" size="2" face="Arial, Helvetica, sans-serif"><%ELSE Response.Write FormatNumber((Recordset3.Fields.Item("Count".Value), 0, -2, -2, -2) & " images" END IF%>

Without breaking the code in two to change the fontcolor, it works fine.

Any idea what's wrong ?

Thanks for help,

Wim

Wim Conix
www.image-belle.com

Replies

Replied 27 Aug 2006 03:03:40
27 Aug 2006 03:03:40 camilo ospina molano replied:
Hello,

You should do it into tables..for example:

<table>
<%IF (Recordset3.Fields.Item("Count".Value) = 0 THEN %>
<tr><td class="here you must build a class for color font ">
<%=Response.Write "registered"%>
</td>
</tr>
<%else%>
<tr><td class="here you must build a class for color font">
<%=Response.Write FormatNumber((Recordset3.Fields.Item("Count".Value), 0, -2, -2, -2) & " images"%>
<%end if%>
</td>
</tr>

it's more easy!!!!

Test it... and tell me please

Camilo Ospina





Edited by - camilopro on 27 Aug 2006 03:04:39

Edited by - camilopro on 27 Aug 2006 03:06:20

Edited by - camilopro on 27 Aug 2006 03:18:06
Replied 27 Aug 2006 03:27:44
27 Aug 2006 03:27:44 Wim Conix replied:
Thanks a lot Camilo !

Thanks to your reply I found how to split up the IF...THEN...ELSE and make the condition work.
I did it this and it works fine :

<%IF (Recordset3.Fields.Item("Count".Value) = 0 THEN%><font color="#888888" size="2" face="Arial, Helvetica, sans-serif"><% Response.Write "registered"%><%ELSE%></font><font color="#CCCCCC" size="2" face="Arial, Helvetica, sans-serif"><%Response.Write FormatNumber((Recordset3.Fields.Item("Count".Value), 0, -2, -2, -2) & " images" END IF%>

Thanks again and have a nice weekend,

Wim

Wim Conix
www.image-belle.com
Replied 27 Aug 2006 03:32:31
27 Aug 2006 03:32:31 Wim Conix replied:
Forgot to tell you...

You can see the result at www.image-belle.com/asp/images/search/search_author.asp

Greetzz,

Wim

Wim Conix
www.image-belle.com

Reply to this topic