From: Bob Barrows on
Paul Randall wrote:
> "Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
> news:eojoyXGvKHA.3896(a)TK2MSFTNGP02.phx.gbl...
>> Al Dunbar wrote:
>>> "Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
>>> news:OGgFSU7uKHA.796(a)TK2MSFTNGP05.phx.gbl...
>>>> Michael Larsen wrote:
>>>>> Hi
>>>>> Is there a way that I can include the same .vbs files in a .wsf
>>>>> and .asp file and having Option Explicit working in both?
>>>>>
>>>> No
>>>
>>> But why would you need option explicit?
>>
>> Ummmm ... I don't know. You'll need to ask the OP. :-)
>> Or is this one of the cases where your newsreader failed to pick up
>> the original post, forcing you to reply to me?
>>
>> But it is a valid question. Oprion Explicit is only really needed
>> while the code is being written and debugged, as you say.
>
> Ummmm ... I don't know. I'm thinking that Option Explicit is really
> needed as long as the possibility exists that it may catch an error.

Explain please. How can an error that Option Explicit would "catch" occur if
the code is not changed?

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
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"


From: Paul Randall on

"Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
news:%23zPfEaKvKHA.3408(a)TK2MSFTNGP06.phx.gbl...
> Paul Randall wrote:
>> "Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
>> news:eojoyXGvKHA.3896(a)TK2MSFTNGP02.phx.gbl...
>>> Al Dunbar wrote:
>>>> "Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
>>>> news:OGgFSU7uKHA.796(a)TK2MSFTNGP05.phx.gbl...
>>>>> Michael Larsen wrote:
>>>>>> Hi
>>>>>> Is there a way that I can include the same .vbs files in a .wsf
>>>>>> and .asp file and having Option Explicit working in both?
>>>>>>
>>>>> No
>>>>
>>>> But why would you need option explicit?
>>>
>>> Ummmm ... I don't know. You'll need to ask the OP. :-)
>>> Or is this one of the cases where your newsreader failed to pick up
>>> the original post, forcing you to reply to me?
>>>
>>> But it is a valid question. Oprion Explicit is only really needed
>>> while the code is being written and debugged, as you say.
>>
>> Ummmm ... I don't know. I'm thinking that Option Explicit is really
>> needed as long as the possibility exists that it may catch an error.
>
> Explain please. How can an error that Option Explicit would "catch" occur
> if the code is not changed?

Good point. I guessASP code that doesn't run because of multiple Option
Explicit statements can not have run time errors.

-Paul Randall


From: Al Dunbar on


"Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
news:#zPfEaKvKHA.3408(a)TK2MSFTNGP06.phx.gbl...
> Paul Randall wrote:
>> "Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
>> news:eojoyXGvKHA.3896(a)TK2MSFTNGP02.phx.gbl...
>>> Al Dunbar wrote:
>>>> "Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
>>>> news:OGgFSU7uKHA.796(a)TK2MSFTNGP05.phx.gbl...
>>>>> Michael Larsen wrote:
>>>>>> Hi
>>>>>> Is there a way that I can include the same .vbs files in a .wsf
>>>>>> and .asp file and having Option Explicit working in both?
>>>>>>
>>>>> No
>>>>
>>>> But why would you need option explicit?
>>>
>>> Ummmm ... I don't know. You'll need to ask the OP. :-)
>>> Or is this one of the cases where your newsreader failed to pick up
>>> the original post, forcing you to reply to me?
>>>
>>> But it is a valid question. Oprion Explicit is only really needed
>>> while the code is being written and debugged, as you say.
>>
>> Ummmm ... I don't know. I'm thinking that Option Explicit is really
>> needed as long as the possibility exists that it may catch an error.
>
> Explain please. How can an error that Option Explicit would "catch" occur
> if the code is not changed?

It can't, unless...

- There is a piece of code that has never executed in testing, but that
could execute under certain conditions, or:
- the code is self-modifying.

The first should never happen in a script containing functions or class
definitions.

The second is to flirt with danger.

That said, I always leave in the option explicit, because to take it out
means modifying working code :-)

Seriously, though, the only reason I see for ever wanting to remove option
explicit is the situation posed by the OP, in which a piece of code is
included in different contexts that handle option explicit differently.

/Al