what is option explicit? what is the use of it?
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 ? | 62 Yes | 1 No |
Post New Answer View All Answers
Which features or drawbacks of QTP lead to the upgrade for a newer version?
Functions call by reference and call by value. i want the diff b/n these 2 and how will be the script for this?in which situation we use these 2..?pls explain me clearly
Who uses qtp tool?
How do know the number of browsers opened?
If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?
how to test Web application using QTP software
in qtp 3 sheets is there in data table like global, action1, action2. I want to check the rows and columns in action2. how can check using script?
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
what is test scheduleling?
What environment does qtp run in?
wht type of User defined functions or Java Releated functions Do we write in VB scripting
Tell me about your project? please help me how to tell about insurance project
How to use reporter.report event in qtp ?
Whats the realtime QTP testing process
Tell me one scenario, the complex functionality you have automated in your project?