Ask a Question related to ASP Database, Design and Development.
-
Matt. #1
ASP classic - variable formatting
Hi all!
I've included a code sample below.
I am trying to format a table cell so that if the value is outside some
predefined range, the bgcolor parameter is different. I realize this has
probably be done a million times, but I can't find any solution. I run the
ASP below, and every value returned from the database is treated as a string
(all left justified). Is there a character-to-numeric conversion function
I've forgotten about so the sample below performs properly? Near the
bottom, the Furnace Temperature value, for example. All values are
currently over 1200. Or should I say "1200"........?
cheers,
Matt.
<tr<% IF (intRowCounter MOD 2) = 0 THEN %> bgcolor="vbCyan" <% END IF %>>
<td><font size = -4><%= rsIndustrial("MACHINE_NUMBER") %></font></td>
<td><font size = -4><%= rsIndustrial("SERIAL_NUMBER") %></font></td>
<td><font size = -4><%= rsIndustrial("DAILY_PART_COUNT") %></font></td>
<td><font size = -4><%= rsIndustrial("EVENT_TIME") %></font></td>
<td><font size = -4><%= rsIndustrial("ACTUAL_SLOW_SHOT_VELOCITY")
%></font></td>
<td><font size = -4><%= rsIndustrial("ACTUAL_INTERMEDIATE_SHOT_VELOCITY")
%></font></td>
<td><font size = -4><%= rsIndustrial("ACTUAL_FAST_SHOT_VELOCITY")
%></font></td>
<td><font size = -4><%= rsIndustrial("FINAL_INTENSIFIER_PRESSURE")
%></font></td>
<td><font size = -4><%= rsIndustrial("INTENSIFIER_PRESSURE_TO_RISE_TO")
%></font></td>
<td><font size = -4><%= rsIndustrial("TIE_BAR_#1_MECHANICAL_TONNAGE")
%></font></td>
<td><font size = -4><%= rsIndustrial("TIE_BAR_#2_MECHANICAL_TONNAGE")
%></font></td>
<td><font size = -4><%= rsIndustrial("TIE_BAR_#3_MECHANICAL_TONNAGE")
%></font></td>
<td><font size = -4><%= rsIndustrial("TIE_BAR_#4_MECHANICAL_TONNAGE")
%></font></td>
<td><font size = -4><% IF rsIndustrial("FURNACE_TEMPERATURE") > 900 THEN
%><bgcolor="vbRed"><% END IF%><%= rsIndustrial("FURNACE_TEMPERATURE")
%></font></td>
<td><font size = -4><% IF rsIndustrial("BISCUIT_LENGTH_LOW") = strTrue THEN
%> <font color="vbRed" <% END IF%><%= rsIndustrial("BISCUIT_LENGTH_LOW")
%></font></td>
<td><font size = -4><%= rsIndustrial("BISCUIT_LENGTH_GOOD") %></font></td>
<td><font size = -4><%= rsIndustrial("BISCUIT_LENGTH_HIGH") %></font></td>
</tr>
Matt. Guest
-
.NET COM in Classic ASP
I have created a simple .NET COM class. I have used regasm dllname.dll /tlb: dllname.tlb /codebase to register it on another server - the files... -
DLL Issue With Classic Asp
Hi everyone, Not sure if this is the right newsgroup for this, but I think it is. I've been having trouble finding any good info on the... -
Distiller 5.0.5 is Classic App?
I bought Acrobat 5.0 almost 4 years ago and it works fine with OS X - Except that I now for the first time need to use distiller for a client's job... -
MAC OS X NOT BETTER THAN CLASSIC!!
OK, I have been using Mac OS X since version 10.0. Now, as a Mac user for more than 13 years, a UNIX/Linux user for more than 8 years, and as IT... -
Classic ASP Table to DataGrid...formatting color and decimal places
Hello, I trying to convert an ASP page to ASP.NET using a DataGrid control. All of the data is being displayed in the DataGrid. But I need help... -
Maarten #2
Re: ASP classic - variable formatting
CInt(myString) to integer
CDbl(myString) to double
CLng(myString) to long
Maarten Guest
-
Matt. #3
Re: ASP classic - variable formatting
Thanks.
I had completely forgotten about those. I also need to edit my <td> tags a
little.
Any idea why vbRed is giving me a Blue cell?
cheers,
Matt.
<td <% IF CINT(rsIndustrial("FURNACE_TEMPERATURE")) < 1230 OR
CINT(rsIndustrial("FURNACE_TEMPERATURE")) > 1290 THEN %>bgcolor="vbRed" <%
END IF%>><font size = -4><%= rsIndustrial("FURNACE_TEMPERATURE")
%></font></td>
"Maarten" <nobody@spam.com> wrote in message
news:fYumc.97620$qC1.6081664@phobos.telenet-ops.be...> CInt(myString) to integer
> CDbl(myString) to double
> CLng(myString) to long
>
>
Matt. Guest
-
Maarten #4
Re: ASP classic - variable formatting
Because it is not know by HTML
bgcolor="<%vbred%>" maybe helps or use
bgcolor="#FF0000"
Maarten Guest
-
Aaron Bertrand - MVP #5
Re: ASP classic - variable formatting
Because whatever editor you are using doesn't understand that your opening
ASP tags end within the HTML ... in other words, it can't differentiate well
between server-side and client-side script.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Matt." <matt_benvenuti_remove@hotmail.com> wrote in message
news:87vmc.36304$3Q4.957666@news20.bellglobal.com. ..a> Thanks.
>
> I had completely forgotten about those. I also need to edit my <td> tags> little.
>
> Any idea why vbRed is giving me a Blue cell?
>
> cheers,
> Matt.
>
> <td <% IF CINT(rsIndustrial("FURNACE_TEMPERATURE")) < 1230 OR
> CINT(rsIndustrial("FURNACE_TEMPERATURE")) > 1290 THEN %>bgcolor="vbRed" <%
> END IF%>><font size = -4><%= rsIndustrial("FURNACE_TEMPERATURE")
> %></font></td>
>
>
>
> "Maarten" <nobody@spam.com> wrote in message
> news:fYumc.97620$qC1.6081664@phobos.telenet-ops.be...>> > CInt(myString) to integer
> > CDbl(myString) to double
> > CLng(myString) to long
> >
> >
>
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #6
Re: ASP classic - variable formatting
Oh good catch, I missed that part... I thought he meant his editor showed it
as blue (which FrontPage et al. might do if it's confused).
Anyway, your correction made a common mistake.
bgcolor="<%vbred%>"
Should be
bgcolor="<%=vbred%>"
The = sign in there is pretty important.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Maarten" <nobody@spam.com> wrote in message
news:fwvmc.97647$1J1.6114439@phobos.telenet-ops.be...>
> Because it is not know by HTML
>
> bgcolor="<%vbred%>" maybe helps or use
>
> bgcolor="#FF0000"
>
>
Aaron Bertrand - MVP Guest
-
Matt. #7
Re: ASP classic - variable formatting
Once again, thank you very much. The <%vbred%> didn't work. But the FF0000
did.
cheers,
Matt.
"Maarten" <nobody@spam.com> wrote in message
news:fwvmc.97647$1J1.6114439@phobos.telenet-ops.be...>
> Because it is not know by HTML
>
> bgcolor="<%vbred%>" maybe helps or use
>
> bgcolor="#FF0000"
>
>
Matt. Guest



Reply With Quote

