Forums

This topic is locked

Show/Hide

Posted 02 Dec 2001 09:54:11
1
has voted
02 Dec 2001 09:54:11 Frank Hierse posted:
Hello,
I don't progress exactly. I try 2 small functions to get one function, but
it doesn't want so right.

First, I have:

<% IF (rs1.Fields.Item("OutOfStock".Value) = "True" Then %>
<b><font color=#FF0000>Out of Stock</font></b>
<% Else %>
<b><%= DoNumber((rs1.Fields.Item("Price".Value), 2, -2, -2, -2, -1) %>
EURO</b>
<%End IF %>

and once:

<% IF (rs1.Fields.Item("SoldOut".Value) = "True" Then %>
<b><font color=#FF0000>Sold Out</font></b>
<% Else %>
<b><%= DoNumber((rs1.Fields.Item("Price".Value), 2, -2, -2, -2, -1) %>
EURO</b>
<%End IF %>

The functions show the price or fade out him, in dependence of the
Yes/No-Fields in the DB.
Can I not summarize these two ones somehow? How this would have to look
approximate?

Greeting from Germany

Frank


Replies

Replied 02 Dec 2001 22:21:53
02 Dec 2001 22:21:53 Frank Hierse replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hello,
I don't progress exactly. I try 2 small functions to get one function, but
it doesn't want so right.

First, I have:

&lt;% IF (rs1.Fields.Item("OutOfStock".Value) = "True" Then %&gt;
&lt;b&gt;&lt;font color=#FF0000&gt;Out of Stock&lt;/font&gt;&lt;/b&gt;
&lt;% Else %&gt;
&lt;b&gt;&lt;%= DoNumber((rs1.Fields.Item("Price".Value), 2, -2, -2, -2, -1) %&gt;
EURO&lt;/b&gt;
&lt;%End IF %&gt;

and once:

&lt;% IF (rs1.Fields.Item("SoldOut".Value) = "True" Then %&gt;
&lt;b&gt;&lt;font color=#FF0000&gt;Sold Out&lt;/font&gt;&lt;/b&gt;
&lt;% Else %&gt;
&lt;b&gt;&lt;%= DoNumber((rs1.Fields.Item("Price".Value), 2, -2, -2, -2, -1) %&gt;
EURO&lt;/b&gt;
&lt;%End IF %&gt;

The functions show the price or fade out him, in dependence of the
Yes/No-Fields in the DB.
Can I not summarize these two ones somehow? How this would have to look
approximate?

Greeting from Germany
Frank
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Thanks for your help <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

This works fine:

&lt;% IF (rs1.Fields.Item("OutOfStock".Value) = "True" Then %&gt;
&lt;b&gt;&lt;font color=#FF0000&gt;Out of Stock&lt;/font&gt;&lt;/b&gt;
&lt;%End if %&gt;
&lt;% IF (rs1.Fields.Item("SoldOut".Value) = "True" Then %&gt;
&lt;b&gt;&lt;font color=#FF0000&gt;Sold Out&lt;/font&gt;&lt;/b&gt;
&lt;% End if %&gt;
&lt;% if (rs1.Fields.Item("OutOfStock".Value) &lt;&gt; "True" AND (rs1.Fields.Item("SoldOut".Value) &lt;&gt; "True" Then %&gt;
&lt;b&gt;&lt;%= DoNumber((rs1.Fields.Item("Price".Value), 2, -2, -2, -2, -1) %&gt; Euro&lt;/b&gt;
&lt;%End IF %&gt;

Frank

Reply to this topic