Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > option explicit

Reply
Thread Tools

option explicit

 
 
Mats
Guest
Posts: n/a
 
      09-12-2004
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!
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-12-2004
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"


 
Reply With Quote
 
 
 
 
PW
Guest
Posts: n/a
 
      09-12-2004

"Bob Barrows [MVP]" <> wrote in message
news:...
> 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 ?



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-12-2004
PW wrote:
> "Bob Barrows [MVP]" <> wrote in message
> news:...
>> 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"


 
Reply With Quote
 
Mats
Guest
Posts: n/a
 
      09-16-2004
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!
 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      09-16-2004
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.


 
Reply With Quote
 
Mats
Guest
Posts: n/a
 
      09-17-2004
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!
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-17-2004
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"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.NET ignoring Option Explicit setting Jerad Rose ASP .Net 1 02-27-2007 02:02 PM
Explicit instantiation of STL vector demands explicit instantiation of all the templates it using internally. krunalbauskar@gmail.com C++ 1 12-25-2006 03:51 PM
What's the difference betwwen explicit instantiaion and explicit specialization? Andy C++ 5 01-30-2005 11:46 PM
Is explicit template qualification required for explicit delete? J.T. Conklin C++ 1 08-11-2004 02:06 AM
How can I set Option Explicit systematically in VB.Net? Eric Mamet ASP .Net 2 10-16-2003 11:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57