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
There are 10 rows in the datatable. How can we fetch 2 rows and then skip 3rd row. After that, pick 4th & 5th row and skip 6th row. Please share code
How to use checkpoints in qtp ?
Explain the use of action split in qtp?
how to evalute defects in QTP script?
What is the pros and cons between QTP and Rational Robot
Explain different type of event trigger option.
How is test case write?
Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji
How software tester can use constants and variables in scripts?
How is recording done when a application is over lapping the QTP application it gives a message object not recorded
Is it possible to call from one action to another action in qtp?
i need qtp tutorial. pls send it to sridhar.k151@g mail.com
what is the diffrence bw qtp architectute and qtp framework?
In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.
How to record application running on the Virtual machine?