This topic is locked

Font color red if negative

8/16/2006 2:40:07 PM
ASPRunnerPro General questions
D
dpkona author

I used to do this with this code:
____

_

if IsBinaryField(rs.Fields("Var")) or Format("Var")=FORMAT_DATABASEFILE then

Response.Write CreateImageControl(rs, "Var", "")

else

strData = GetData(rs.Fields("Var"), "Number")

if rs("Var")<0 then Response.Write "<span style=""color:red"">

Response.Write ProcessLargeText(strData)

if rs("Var")<0 then Response.Write "</span>"
<!--Response.Write ProcessLargeText(strData)-->
end if

____


but with 4.0 the code has changed a little

____

_

if IsBinaryField(rs.Fields("JulVar")) or Format("JulVar")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rs, "JulVar", "")

else

strData = GetData(rs.Fields("JulVar"), "Number")
if Format("JulVar")<>FORMAT_HTML then

Response.Write ProcessLargeText(strData,"picfield=" & Server.URLEncode("JulVar") & "&where=" & Server.URLEncode(strImageWhere),"",MODELIST)

else

Response.Write strData

end if
end if

____



I try to edit this code with the edits that worked before and it doesn't work.

J
Jane 8/17/2006

Hi,
try to edit it in the following way:

if IsBinaryField(rs.Fields("JulVar")) or Format("JulVar")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rs, "JulVar", "")

else

strData = GetData(rs.Fields("JulVar"), "Number")
if Format("JulVar")<>FORMAT_HTML then

if rs("JulVar")<0 then Response.Write "<font color=red>" end if

Response.Write ProcessLargeText(strData,"picfield=" & Server.URLEncode("JulVar") & "&where=" & Server.URLEncode(strImageWhere),"",MODE_LIST)

if rs("JulVar")<0 then Response.Write "</font>" end if

else

Response.Write strData

end if
end if