[thelist] ASP - Hexidecimal - calculations

Ken Schaefer ken at adOpenStatic.com
Mon May 31 20:14:17 CDT 2004


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Lightning" <oktellme at earthlink.net>
Subject: [thelist] ASP - Hexidecimal - calculations


: Does anyone here know how to compute hexadecimal in asp?
:
: I've been searching the web for hours!  I need to take a hex color value
and
: increase it by ten.,
:
: I'm separating the rbg parts. But any calculation I try to do is failing.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reading the manual would have solved this for you in a few minutes. I'm
sorry that you've spent hours on this already. The WSH documentation can be
found here. It is an invaluable resource:
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en

I assume that you want to do this in VBScript (rather than JScript)

Numbers in hex can be represented directly by prepending &H. There is a
function to convert decimal to hex, funnily enough is Hex()

<%
' Add 32 and 10 where they are in hex
Response.Write(Hex(&H20 + &HA))

' Add 32 and 10 when they are in decimal format
Response.Write(Hex(32 + 10))
%>

To find this information in the documentation, open it, switch to "Index"
tab, scroll down till you reach "hex function", and view that topic.

Cheers
Ken



More information about the thelist mailing list