Strange Error in Function

T

Tony

Can anyone help me with this error?

code start ____________________________________________
Microsoft VBScript compilation error '800a03ee'
Expected ')'
/example.asp, line 142
Private Function FuncDiff(ByVal DateOne As DateTime, ByVal DateTwo As
DateTime)
------------------------------------------^
code end ____________________________________________

(for those of you using proportional fonts, the ^ is pointing to the space
between "DateOne^As")

The surrounding code is

<%
Private Function FuncDiff(ByVal DateOne As DateTime, ByVal DateTwo As
DateTime)
Dim Year1, Month1, Day1 As Integer
:
%>

A Google on this didn't help. The code looks good to me (of course).

Anybody have any ideas how to fix this?

THANKS,

Tony
 
B

Bob Barrows [MVP]

Tony said:
Can anyone help me with this error?

code start ____________________________________________
Microsoft VBScript compilation error '800a03ee'
Expected ')'
/example.asp, line 142
Private Function FuncDiff(ByVal DateOne As DateTime, ByVal DateTwo As
DateTime)
------------------------------------------^


All variables are variants in vbscript. It is illegal to try to asssign
datatypes to them

Private Function FuncDiff(ByVal DateOne , ByVal DateTwo)
 
T

Tony

"Bob Barrows [MVP]" wrote...
All variables are variants in vbscript. It is illegal to try to asssign
datatypes to them

Private Function FuncDiff(ByVal DateOne , ByVal DateTwo)
--

Got it - thanks, Bob. But I've got a new problem - when the function tries
to return a string, I'm getting
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Return'

How do I define an ASP function so as to return a string?
 
T

Tony

...
:
Got it - thanks, Bob. But I've got a new problem - when the function tries
to return a string, I'm getting
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Return'

How do I define an ASP function so as to return a string?

Never mind, I fixed it.
Instead of

Private Function FuncDiff(ByVal DateOne , ByVal DateTwo)

' answer is the return value
Return answer

I needed

FuncDiff = answer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top