Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Option Explicit


Message #1 by "Chuck" <chuck@c...> on Mon, 3 Feb 2003 21:48:18 -0600
  When I add Option Explicit to my ASP pages I get the error:

    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement

Has anyone encountered this before?

Thanks Much,
   Chuck

Message #2 by "Ken Schaefer" <ken@a...> on Tue, 4 Feb 2003 16:24:44 +1100
Option Explicit needs to be the first line of your ASP page (after any @
declarations) eg:

<% @Language=VBScript EnableSessionState=False %>
<%
Option Explicit
%>

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chuck" <chuck@c...>
Subject: [asp_web_howto] Option Explicit


  When I add Option Explicit to my ASP pages I get the error:

    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement

Has anyone encountered this before?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #3 by "Chuck" <chuck@c...> on Tue, 4 Feb 2003 19:17:41 -0600
AH! that's it.
strange, it has to be the first lines in the whole page, not just in the
code.

 Thank you very much,
   Chuck

-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: Monday, February 03, 2003 11:25 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Option Explicit


Option Explicit needs to be the first line of your ASP page (after any @
declarations) eg:

<% @Language=3DVBScript EnableSessionState=3DFalse %>
<%
Option Explicit
%>

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chuck" <chuck@c...>
Subject: [asp_web_howto] Option Explicit


  When I add Option Explicit to my ASP pages I get the error:

    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement

Has anyone encountered this before?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Message #4 by "Ken Schaefer" <ken@a...> on Wed, 5 Feb 2003 18:02:41 +1100
If it's not at the top of the page, how does it know whether you haven't
already attempted to use a variable?

Also, why do you write pages where there is stuff before your code? Most
"good" ASP page layout usually involves something like:

<%
Option Explicit
' All your code here
' Set all your variables
' Put recordset's into arrays using GetRows
' Close/Dispose of all objects
%>
<html>
    <!-- HTML goes here -->
</html>

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chuck" <chuck@c...>
Subject: [asp_web_howto] Re: Option Explicit


AH! that's it.
strange, it has to be the first lines in the whole page, not just in the
code.

 Thank you very much,
   Chuck

-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: Monday, February 03, 2003 11:25 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Option Explicit


Option Explicit needs to be the first line of your ASP page (after any @
declarations) eg:

<% @Language=VBScript EnableSessionState=False %>
<%
Option Explicit
%>

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chuck" <chuck@c...>
Subject: [asp_web_howto] Option Explicit


  When I add Option Explicit to my ASP pages I get the error:

    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement

Has anyone encountered this before?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





  Return to Index