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
What is ‘object spy’ and what is the function of object spy in qtp?
Where you get the run time data table?
how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?
How many types of recording modes are there?
Hoe can we do retesting using functions please give the code for it using login page
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
Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out
What is a data driven test in qtp?
Does QTP record on Objects created on XWindows Environment?
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
I have developed and executed a script successfully, and saved the same to QC. When I tried to execute the script from QC, the script is not executing. What are the possible reasons?”
Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya
How to check bitmap output value?
hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me
hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.