When and why do you use "OPTION EXPLICIT" in VB Script.
Is there any online help or something to learn the script
for Beginners?
Answer Posted / pallavi nandula
When you use the Option Explicit statement, you must
explicitly declare all variables using the Dim, Private,
Public, or ReDim statements. If you attempt to use an
undeclared variable name, an error occurs.
VBScript ingeneral doesn't need variable declaration. For
example without using "Dim" a variable can be directly used
for assigning etc. For ex: temp=1
However, such practise can always be error prone. Ex: if i
want to use the same variable in someother statement and
miss spell it,say
tempe=temp+1
VBScript still considers "tempe" as valid. This case if we
use OPTION EXPLICIT On top of our application and proceed
then application will not proceed unless until u declare
each and every variable. Hence u make sure that ur variable
is serving ur purpose.
in this example u recognize that "tempe" is not desired.
Hope this clarifies.
Is This Answer Correct ? | 88 Yes | 4 No |
Post New Answer View All Answers
what is the difference btn risks & Therads in the Test plan documentation?
www.icici.com ,after this.. home page wll came, in this page what r the items we r going to test for manual and what are items we r going to test for QTP... explian clearly with example
Differences between quicktest professional (qtp) and winrunner?
Please guide me release notes of Automation once scripts are completed
Which recording modes need more memory?
What is 'sleep' in sync point?
what type of automation is follwed in the project?
hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]
What are the steps involved in recovery scenario wizard?
To which environments does quicktest professional (qtp) supports?
What is checkpoints for qtp?
Why we load add-ins in qtp?
How will you report the bug and explain the defect tracking sheet you handled?
Explain the types of object repository?
Hybrid framework supports Descriptive programming. Is it true?