what is use of optionexplicit in variable declaration

Answer Posted / aa

If we don't use it, we can declare variables in vbscript
without declaring them in advance.
Ex:

option explicit
a=10

This throws an Error.

If don't use... Option explicit
a=10
doesnot throw an error.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have written a code to fetch values fro access db and place in the fields. Iam using GetROProperty to fetch runtime values. Now i want to add runtime values to the access db in field v3. please help me. Its not writting in the db. Option explicit Dim con,rs,db,c Set con=createobject("adodb.connection") Set rs=createobject("adodb.recordset") con.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=D:\Sales.mdb" rs.open "select * from tax",con Do while not rs.eof Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("incost").Set rs.fields("v1") Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("intax").Set rs.fields("v2") c=Browser("Sales Tax Calculator").Page("Sales Tax Calculator").WebEdit("outtax").GetROProperty("value") rs.MoveNext print c Loop Do while not rs.EOF rs.EditMode rs.Fields("v3").Value="3" rs.Update rs.MoveNext Loop Set rs=nothing Set con=nothing

1485


Explain more about the Test Fusion Report of QTP?

606


How do I get the QTP scripts result in xml format by using vb script function?

1785


What is the use of "New Property" in "Add properties" of testobject properties in object repository. How can i use "New properties" while writing scripts if i have assign some values to the testobject properties Can anyone help me? plz

1478


why should we give deliver good quality software?

1627






how can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods

1382


How do you create regression test packs?

611


How QTP support all types of applications (platforms)?

4081


What are the factors on which script execution time is dependent?

610


How will you compare keyword and expert view?

540


• What type of testing questions will be asked for 2+ yrs exp people in interview?

1259


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What's the difference between them? How to handle script issues?

533


could any help me please, how to work on visual foxpro application using UFT

1687


What are the views available in quicktest professional (qtp)?

575


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

1628