Error with option explicit

Discussion in 'ASP General' started by Robert Mark Bram, Aug 15, 2004.

  1. Hi All!

    I have the following in a vb script:

    option explicit
    Response.Expires = -1
    Server.ScriptTimeout = 600

    The script gets imported in the following way:
    <script language="VBscript" runat=server src="lib/upload/aspUpload.asp">
    </script>

    I get the following error:

    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement
    /RobertMarkBram/lib/upload/aspUpload.asp, line 10
    option explicit


    I do *not* have this in my script:
    <%@ LANGUAGE=VBSCRIPT EnableSessionState=False %>
    <%
    Option Explicit
    %>

    Because the script is an external vb library.. (I use JavaScript on the same
    page).

    Can anyone suggest how I can get option explicit in there?

    Thanks for any advice!

    Rob
    :)
    Robert Mark Bram, Aug 15, 2004
    #1
    1. Advertising

  2. Robert Mark Bram wrote:
    > Hi All!
    >
    > I have the following in a vb script:
    >
    > option explicit
    > Response.Expires = -1
    > Server.ScriptTimeout = 600
    >
    > The script gets imported in the following way:
    > <script language="VBscript" runat=server
    > src="lib/upload/aspUpload.asp"> </script>
    >
    > I get the following error:
    >
    > Error Type:
    > Microsoft VBScript compilation (0x800A0400)
    > Expected statement
    > /RobertMarkBram/lib/upload/aspUpload.asp, line 10
    > option explicit
    >
    >
    > I do *not* have this in my script:
    > <%@ LANGUAGE=VBSCRIPT EnableSessionState=False %>


    irrelevant

    > <%
    > Option Explicit


    Are you sure?

    "Option Explicit" can only be used one in a page. If it appears in an
    included file, it cannot appear in other included files, nor in the "host"
    page.

    Bob Barrows

    --
    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], Aug 15, 2004
    #2
    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. J.T. Conklin
    Replies:
    1
    Views:
    427
    David Hilsee
    Aug 11, 2004
  2. Andy
    Replies:
    5
    Views:
    494
    Shezan Baig
    Jan 30, 2005
  3. Replies:
    1
    Views:
    558
    Salt_Peter
    Dec 25, 2006
  4. John Kotuby

    Option Explicit causing VBScript error

    John Kotuby, Mar 23, 2006, in forum: ASP General
    Replies:
    6
    Views:
    173
    Patrice
    Mar 24, 2006
  5. S N
    Replies:
    0
    Views:
    318
Loading...

Share This Page