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 / ritesh mahendrakar

You can declare variables with the Dim, Public or the
Private statement. Like this:

Dim myname
myname = "ritesh"

However, this method is not a good practice, because you
can misspell the variable name later in your script, and
that can cause strange results when your script is running.

If you misspell for example the "myname" variable
to "mynime", the script will automatically create a new
variable called "mynime". To prevent your script from doing
this, you can use the 'Option Explicit' statement. This
statement forces you to declare all your variables with the
dim, public or private statement.

Put the Option Explicit statement on the top of your
script. Like this:

Option Explicit
Dim myname
myname = "ritesh"

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does mean by Scope of Automation?n How we defined it?

1655


What is text/text area checkpoint?

666


How to carry out bit map check points in QTP

1843


How can i initiate the objects to find uniquely in OR

1552


How will internal and external links be validated and updated? how often?

752






In what occasion we can specify global sheet and action sheet?

649


How to record application running on the Virtual machine?

736


if mandatory and Assitive propertys are shows same how will u write skript in QTP window

1729


distinguish between old version and new version QTP features.

1971


Can launch two instances of qtp on the same machine?

655


How many types of actions are there in quicktest professional (qtp)?

626


what is key word driven frame work ? why it is called like that ? what is the diference between keyword driven and data driven frame work ?

1650


iam working in QTP for 2+ of exp if i attend the interview what r questions asked in perfomence testing{loadrunner} ? pls any one can say answer to this question?

1704


How does you pass optional arguments in qtp?

659


How to save your test using quicktest professional (qtp)?

699