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

Re: Functions = Type mismatch by Ray

Ray
Thu Mar 31 16:20:03 CST 2005

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

"James" <anonymous@discussions.microsoft.com> wrote in message
news:044201c5363e$7f70fa70$a501280a@phx.gbl...
> 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