val function in asp

How do I use "VAL" function is asp?
this code here works in vb but not on asp
Please Help.

Mid(Temp, I, 1) = Chr(Val("&H" & Mid(HexStr, I * 2 - 1, 2)))

Thank you.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You don't need to use it:

Mid(Temp, I, 1) = Chr("&H" & Mid(HexStr, I * 2 - 1, 2))

This works fine w/out the Val function.
MAXMASTERAuthor Commented:
thanks for your answer so maybe you could help me with this error im
getting after removing the val

error in this line

Mid(Temp, I, 1) = Chr("&H" & Mid(HexStr, I * 2 - 1, 2))

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'Mid'

When I said it works fine, I was looking at the right side of the equation (which is fine).  

You can't use Mid() as an assignment in asp.  You'll have to append inside a loop or something similar instead.

For example:

Temp = ""
I = 1
Do While I <= Len(HexStr)/2
   Temp = Temp & Chr("&H" & Mid(HexStr, I * 2 - 1, 2))
   I = I + 2
Response.Write(Temp)  <--- Produces "ABC"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MAXMASTERAuthor Commented:
Ok I will give you the points but I cant use that code anymore because it somewhat give me a wrong value

anyway thank you for your help

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.