Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / cnu_thatavarthi

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

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

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

Post New Answer

More VB Script Interview Questions

How to check the particular window is exist or not with out using check points

2 Answers  


In qtp, how to use XML files for framework. if the XML files are more Efficient than Excel files?

1 Answers  


How are comments handled in the vbscript language?

0 Answers  


How will you convert a string to upper case string using vbscript?

0 Answers  


can anybody tell vb script code for alphanumeric and special character .which is used in qtp the name text field.

1 Answers  


What are lbound and ubound in the vbscript language?

0 Answers  


What is event handling in vbscript?

0 Answers  


how to acces the remote mechine using vb cript(QTP)

0 Answers   TCS,


Mention what is vbscript procedures?

0 Answers  


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

0 Answers  


Explain sga memory structures?

0 Answers  


how to genarate a random numbers in vb?

2 Answers  


Categories