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 can the spaces from the string be removed?

793


Explain the asc function?

691


How will you get the last occurrence of one string within another string using vbscript?

956


For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com

1971


How will you get the natural logarithm of the given number in vbscript?

811


What is the difference between function and procedure?

848


How to take whole text output from screen of Bitmap Application.

2079


Explain about tristate constants in vbscript?

828


how to check whether link is disabled in QTP??

5831


Which function is used to perform string comparison?

805


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

766


Explain the scope of the variables using dim, public, and private keywords respectively.

929


What is the event handling in vbscript?

752


Explain the support of asp for vb script functionality?

837


Explain about tristate constants?

772