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
Explain about the test fusion report of quicktest professional?
Can any one explain me what is the procedure to connect the remote desk by using QTP 9.2 ?
what is Property......End Property loop? how to write sript for it in QTP
Hi Friendss..., can any body help me.. 1. Tell me your achievements(Technically)..? 2. Tell me your strengths(Technically) and weakness(Technical)..? 3. Why are you looking for change..?
What is regular expression?
How to use Environment parameterization? Explain with an example.
what is stepin & stepout?
How can I find out the cursor position through QTP suppose I am keep tabbing(Pressing the tab key continuously) and stoped at a position Now I want to find out where the cursor position is
What do you mean by iteration?
Discuss quicktest professional (qtp) environment?
Could i know how how to explain keyword driven framework in interview? If any body knows plz send the explanation.
Can anybody post some real time scenario in qtp? please its very urgent.
Suppose you are using shared objects repository in your test and you want to split your present action? At that time shared object repository is single or it’s also splits?
Does Low-level recording capture mouse movements?
What is clean sweep?