What is the use of "Option Explicit"?

Answers were Sorted based on User's Feedback



What is the use of "Option Explicit"?..

Answer / sonal.pagare

You can force VBScript to require all variables to be
explicitly declared by including the statement Option
Explicit at the start of every script. Any variable that is
not explicitly declared will then generate an error.

Is This Answer Correct ?    5 Yes 0 No

What is the use of "Option Explicit"?..

Answer / bharathchandra m

"Option Explicit" statement is used to declare variables and
arrays on the top of the script.When this stmt in script ,QTP
can allows all variables used in that script without
returning any error.

For example: x= 10
y= 20
z= c*y
msgbox(z)
In the above code, by mistakenly typed as 'c' in the place
of 'x'. Bur QTP tool allows 'c' as a new variable without
returning error.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

did any one attended interview in applabs if you had gone through plz tell me the procedure

0 Answers  


filter the array values without using filter function?

0 Answers   CSS Corp, WQED,


Suppose by navigation I went from 1 st page to 5 page ,so Write a generic script for coming from any page to the 1st page and by executing where the page may be it will come to 1st page

1 Answers   CybAge,


generic function for webedit box for web application

1 Answers  


I wrote the vbscript code on notepad i was geeting run time error "object required line 1" my code is set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signin("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Setsec ure.Crypt.Encrypt("entr password") browser("gmail").page("gmail").WebButton("siginobj").click pls tell me whats wrong

1 Answers  






Explain about .wsf files?

0 Answers  


What are the 2 ways in which a variable can be declared in the vbscript language?

0 Answers  


How you can call vbscript functions?

0 Answers  


how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me

3 Answers   TCS,


There is a web Table where You will find Two Columns First Column consist of Check box and Second column consist of Test cases ID(Viz T1,T2,T3....Etc); If You select any Test case ID, respective Check boxes to be checked write a VBSCRIPT for this scenario?

1 Answers   eMids,


What is the difference between javascript and vbscript?

0 Answers  


Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards

0 Answers  


Categories