473,396 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

option explicit

Option Explicit does not work anymore.(?)
If you put <%option explicit%> at the top of your pages (direktly after
the language declaration) you should get an error for each undeclared
variable. This does not happen, but undeclare variables lead to some odd
results.

Error somewhere or has IIS changfed its behavior?
"Testbed" Win XP Pro SP2

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
7 3367
Mats wrote:
Option Explicit does not work anymore.(?)
If you put <%option explicit%> at the top of your pages (direktly
after the language declaration) you should get an error for each
undeclared variable. This does not happen, but undeclare variables
lead to some odd results.

Error somewhere or has IIS changfed its behavior?
"Testbed" Win XP Pro SP2


<%option explicit%> affects only server-side code. The brwoser used to test
this should not matter.

If you want option explicit in client-side vbscript (which is not
recommended), then you have to make it the first line executed in your
client-side script.

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"
Jul 19 '05 #2
PW

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
If you want option explicit in client-side vbscript (which is not
recommended), then you have to make it the first line executed in your
client-side script.


Why is option explicit in client-side vbscript not recommended ?

Jul 19 '05 #3
PW wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
If you want option explicit in client-side vbscript (which is not
recommended), then you have to make it the first line executed in
your client-side script.


Why is option explicit in client-side vbscript not recommended ?

I meant that vbscript code in client-side script is not recommended,
especially if you want cross-browser functionality.

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"
Jul 19 '05 #4
Hi
Thanks for reply - been to busy to check until now.
No, it's not client side, it is in my testbed IIS on Win XP pro SP2
I use it to see the result before uploading to the server
Mats

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5
Mats wrote:
Hi
Thanks for reply - been to busy to check until now.
No, it's not client side, it is in my testbed IIS on Win XP pro SP2
I use it to see the result before uploading to the server


Context, please.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #6
In any asp page where I try to use Option Explicit
there is no error message for undimmed variables, the page just does not
execute. Other errors produce an error page in the normal way (just
tested)
Pages begins
<%@ Language=VBScript %>
<%option explicit%>
<%'more code and html....%>
It used to produce an error for undimmed variables and it should...
It also happens when I test a page (with an undimmed variable) on the
server for our homepage (IIS 6.0) not just on my "testbed" (IIS 5.1)
Any patch that might change the behavior of IIS?
It seems that not just my pc is affected.
Mats

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #7
Mats wrote:
In any asp page where I try to use Option Explicit
there is no error message for undimmed variables, the page just does
not execute. Other errors produce an error page in the normal way
(just tested)
Pages begins
<%@ Language=VBScript %>
<%option explicit%>
<%'more code and html....%>
It used to produce an error for undimmed variables and it should...
It also happens when I test a page (with an undimmed variable) on the
server for our homepage (IIS 6.0) not just on my "testbed" (IIS 5.1)
Any patch that might change the behavior of IIS?
It seems that not just my pc is affected.
Mats


This really doesn't help. For all we know, there could be something in

<%'more code and html....%>

that is causing this behavior. You should produce a real 3 or 4 line page
that exhibits the behavior so we can attempt to reproduce it. Here's my
attempt:

<%@ Language=VBScript %>
<%option explicit%>
<%
s = "testing"
response.write "s contains """ & s & """"
%>

Are you saying that when you copy this into a page and run it that you get
neither an error message nor a result from the response.write? I'm running
IIS6 on XP Pro SP2 and I get the expected error when I run this page. I
tried it on my company's servers and still received the expected error.

Does your web server have a custom error page? Is it configured to not send
error messages to the client?

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"
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: biro man | last post by:
I have a dynamic database driven page that I have been working on and tweaking etc until I have got it to work pretty much the way I want it to. I also have a defined website. I wish to include...
1
by: Robert Mark Bram | last post by:
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"...
12
by: Doug Hill | last post by:
Please, Microsoft, update Option Explicit Option Strict barks at late binding. We love late binding. So Option Strict flags too many things. Option Explicit is misleading. It allows Dim...
5
by: ken | last post by:
hi All What does this command dot Option Explicit
6
by: Brett | last post by:
I find there is more casting required in C# than VB.NET. If Option Strict/Explicit is turned on, will this basically create the same environment as C# - uppercase, more casting required, must...
9
by: YYZ | last post by:
After reading many messages in this group, it seems that the preferred setting for this is ON. Okay, I did that in my project (first with ..Net -- long time VB6 developer) and now a bunch of...
6
by: John Kotuby | last post by:
Hi all, I am simply trying to include the Option Explicit declaration at the top of an ASP page and am getting an error: Error Type: Microsoft VBScript compilation (0x800A0400) Expected...
0
by: Michael Jenck | last post by:
Hi All, I have been playing with the codedom and can't get it to output for option compare Binary with a CodeCompileUnit. I have searched the web and Don't now if it's possible. If it's not...
1
by: Jimmbo | last post by:
I get an option explicit error saying it does not appear as the first line whenever I use it with utf-8 charset encoding on my Sun Cobalt server running Chillisoft on Linux. The error does not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.