473,466 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Jul 22 '05 #1
1 1214
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" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@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

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Laura | last post by:
Help. Below is my code. Getting Type mismatch error on the noted line. I'm trying to send an array (aryNewD) with 4 columns and x rows to a function to save all the array info into a SQL Server...
5
by: Arun Wadhawan | last post by:
Hello MY SQL Server is causing me this problem : Microsoft VBScript runtime error '800a000d' Type mismatch: 'ident' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I am getting from...
1
by: LJgrnl | last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData has the initial value False. If a recordset comes back empty (both .EOF and ..BOF are true) then blnNoData is set to...
4
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column...
6
by: Howard Kaikow | last post by:
I'm doing a VB 6 project in which I am trying to protect against type mismatch errors. Is the process any different in VB .NET? Here's what I'm doing in VB 6. I have an ActiveX DLL. The...
4
by: herman404 | last post by:
Hi everyone, I am trying to write a function that will be called from another function. It will do a save as on a word document, and the document name will be passed via a parameter. I keep...
35
by: strictly_mk | last post by:
Hi all, forgive me if there is a simple solution for this. I am going through the following piece of code which simply calculates factorials out of a book, but when i run it I get the answer 0 for...
33
by: jobo | last post by:
If I have the function: int f(int (*h)(int)) { return (*h)(13); } What exactly does (int (*h)(int)) do? So it's taking a pointer but what's with the two ints? Thanks.
127
by: sanjay.vasudevan | last post by:
Why are the following declarations invalid in C? int f(); int f(); It would be great if anyone could also explain the design decision for such a language restricton. Regards, Sanjay
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.