what is option explicit? what is the use of it?

Answer Posted / rajendra

In VB script

option explicit forces the user to declare every variable
used in the code.

In VB Script is not mandatory to declare the variables.

VB script will be processed by windows scripthost.

Some time script host maynot haddle the undiclared
variables.

so it is a good practice option explicit on the top of the
script code.

once if u declare "option explicit" the each any every
variable must be dicalred before using it in code.

other wise it fires an error nad not allow to run the
script on Windows script host.

It is good coding practice to use "option explicit" on the
top of the code.

byeee

Rajendra Prasad Reddy
rajendra_penumalli@yahoo.com
+919885162742
hyderabad
india

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can any suggest me what is exposure testing?

1376


what is output value in QTP and how it can be used in automation testing

1437


After fixing the bug, the same bug is raising again and again in new builds what we have to do? That bug is high level bug.

5880


I want to do QTP Certification what is the pattern of Question paper.

1745


The structure of keyword driven frame work is like a folder structure the different sub folder are 1-functional libray folder 2-object repository folder 3- database folder 4-appliction1.xls 5-initalzation vbs file 6-sequence file 7-driver script 8-test case list file My question is whether these are in a local server machine or in our pc.((whether It like Vss). can u give example of driver script(code)

2802






wt is the use of multiple questions in QTP

1675


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

599


how do you parameterize search button from the website? the page is a single winobject and i have made a virtual object button of search button but search box can't be converted into a winedit and if we try to convert it into winedit the value we enter in a searchbox appears as numbers in the script so we arent able to parameterize.help!!!

1736


Approach for Installation,comaptibility,system testing

1708


What is the use of text output value in quicktest professional (qtp)?

600


What is the extension of the qtp local repository?

568


when a test case is written how u test using qtp

1653


Hi, I am using 2 excel sheet.First excel sheet works fine with the script, if it opens the 2nd excel sheet,it works fine,but after finish all the rows it is giving the following error in the following line. InValid Procedure call or argument Line (178): "Browser("name:="&result,"application version:=internet explorer 7").Page ("title:=bgt.*", "index:=0").WebList ("name:=SearchType","html id:=Select1","location:=0").Select SearchType1". I have seen a web article says that,If we use any vbscript friendly name it may gives the above error-Invalid procedure call or argument not sure,Am I using any VBScript frienlyName? in the above line? [but the same line is perfecly working for first Excel ] It is little urgent. Any Help Thanks you

1443


Thanks....But can u tell me how i use the QTP for GIS with one Example...

1429


What is difference between run time object and test object?

558