Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Functions = Type mismatch

Reply
Thread Tools

Functions = Type mismatch

 
 
James
Guest
Posts: n/a
 
      03-31-2005
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
 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      03-31-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" <(E-Mail Removed)> wrote in message
news:044201c5363e$7f70fa70$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL Type Mismatch error indexed name returns a value whose type does not match programmingzeal VHDL 0 05-06-2012 06:38 AM
type mismatch error amitbadgi@gmail.com ASP .Net 3 08-12-2005 11:23 AM
data type mismatch error amitbadgi@gmail.com ASP .Net 1 08-10-2005 01:04 PM
Type mismatch using Mozilla ActiveX in place of Microsoft WebBrowser? Noozer Firefox 0 05-19-2004 08:08 AM
Type mismatch - using arrays and functions Laura ASP General 4 07-24-2003 12:30 AM



Advertisments