Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Functions = Type mismatch (http://www.velocityreviews.com/forums/t798391-functions-type-mismatch.html)

James 03-31-2005 10:10 PM

Functions = Type mismatch
 
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

Ray Costanzo [MVP] 03-31-2005 10:20 PM

Re: Functions = Type mismatch
 
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





All times are GMT. The time now is 06:08 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.