Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch error when calling a function

Status
Not open for further replies.

princessk1

Programmer
Feb 28, 2002
74
CA
I am trying to call a function but am getting a Type Mismatch error on the line of code that calls the function.

This is part of my code:

<SCRIPT LANGUAGE = &quot;VBSCRIPT&quot;>
Function Calculate(ctgy)
..code that does a calculation based on the category passed to it
End Function
</SCRIPT>

<% Calculate(&quot;General&quot;) %>

All I am trying to do is pass the string general to the calculate function but I keep getting the type mismatch error. I have also tried passing it without parenthesis - which also gives the same error. I know this must be something really simple but I can't seem to get past it. Thanks in advance.
 
Looks like your function has been declared in client side vbscript, and you're trying to call it in server side script. Try declaring the function between <%%>'s and see if that helps.

[thumbsup]
paul
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top