Functions = Type mismatch

J

James

Could you help me understand why this isn't working. I
have a function:

Function evaluateSwitch(x)
if x = "T" then
evaluateSwitch = "border"
else
evaluateSwitch = "altborder"
end if
End Function


When I do this:
response.write evaluateswitch(highlightSwitch)

It displays correctly (border)

But when I try to incorporate it into a division like this:
<div class="<%=evalutateSwitch(highlightSwitch)%>"></div>

It does not work and gives me a type mismatch error. Do
you have any ideas on why this isn't working.

Thanks,

James
 
R

Ray Costanzo [MVP]

Put "Option Explicit" at the top of the page. Getting into the habit of
doing so will avoid such confusion and immediately alert you to the fact
that you have a typo.

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top