how do you make the variable declaration mandatory?what is the use of "option explicit"?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write functions and sub in vb script?

625


PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com

1667


Mention what is byref and byval parameters in vbscript?

579


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

1791


What is loose binding? Why is it not a good practice to use it?

635






How many types of operators are available in the vbscript language?

539


Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?

807


Is vbscript language a case-sensitive language and what does it mean?

550


Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com

1049


How to Import data from a file (file is on the desktop) to the data table

1562


Write a Script for ATM in QTP

3345


How to create a function in vbscript?

590


What are the different types of loops available in the vbscript language?

536


what is the differance between BYVAL,BYREF?

1772


Explain a few date functions in vbscript

558