how do you make the variable declaration mandatory?what is the use of "option explicit"?
Answers were Sorted based on User's Feedback
Option Explicit
Dim strValue, strValue
strValue = 20
'Expected Error: Name(Variable) is redefined
Dim intA, intB
intC= intA+intB
'Expected Error: Name(Variable is undefined)
Note: If we can use Option Explicit we have To pass the all the variables And it Is indentify undefined And redefined
variables
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sonali
Option explicit will make compulsory to define each variable in the script .
if at the top of the script we have written "Option Explicit" and in Dim only two variables assigned but in script somewhere used 3rd and 4th variable also .
then it will display an error message stating that "Variable is Undefined " .
It will be very very usefull in lenghy scripts where we will use different Functions and then call functions .
Is This Answer Correct ? | 0 Yes | 0 No |
How to return only alpha bate string from an string str = "bibhu@#$%&das&*)(SUndar"
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
How to Import data from a file (file is on the desktop) to the data table
How to create a function in vbscript?
I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?
How to open excel in vb script?
What is vbscript?
how to write validation function for date in vb script
How many data types are supported in Vbscript?
Which in-built function is used to format the number in the vbscript language?
Does VB/Win make standalone .EXE files?
hey please tell me how to retriev data from excel sheet which puts the login name and password in the application? plz send me the code..please help me