Strange Error in Function

Discussion in 'ASP General' started by Tony, Jun 17, 2005.

  1. Tony

    Tony Guest

    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
    Tony, Jun 17, 2005
    #1
    1. Advertising

  2. Tony wrote:
    > 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)
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jun 17, 2005
    #2
    1. Advertising

  3. Tony

    Tony Guest

    "Bob Barrows [MVP]" wrote...
    > Tony wrote:
    > > 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)
    > --


    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?
    Tony, Jun 17, 2005
    #3
  4. Tony

    Tony Guest

    "Tony" wrote...
    :
    > 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
    Tony, Jun 17, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan
    Replies:
    2
    Views:
    1,428
    Mike Treseler
    Dec 16, 2004
  2. Harvey Twyman
    Replies:
    8
    Views:
    562
    August Derleth
    Oct 25, 2003
  3. Hole
    Replies:
    4
    Views:
    374
  4. A strange string function error

    , Nov 7, 2008, in forum: C Programming
    Replies:
    7
    Views:
    341
    Ulrich Eckhardt
    Nov 8, 2008
  5. AlexHWGUY
    Replies:
    5
    Views:
    158
    John W. Krahn
    Oct 24, 2006
Loading...

Share This Page