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
assume i have few url link how will i dynamically call then using descriptive programming?
How can i use virtual objects? If have i created one new virtual object in a virtual object manager by following instructions.
what is the hierarchy to use properties in descriptive programming
How many types of recording modes in the qtp?
wht type of User defined functions or Java Releated functions do we write in VB scripting
Discuss quicktest professional (qtp) environment?
supose i hv to acsess some functionlaties of a test in 1 machin , some part other machin how can acsess?
hi can any body give me a script for creating a modularity or keyword driven framework..i am working as a qtp tester for 2 months but still i am not exposed to framework in my company
What are the recording modes in wave event?
Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji
What is debugging? How you debug your script?
1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?
How to creating an output value using quicktest professional (qtp)?
Hi all, I am using windows vista, I am in the process of learning QTP. When ever I try to work with insert mode in flight application , i am getting the error of 'Operation must use an update table query, fractional truncation(null) error. Can anyone help me regarding this?
What is the difference between qtp and selenium?