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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Description.Create

2162


Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.

2560


Which function is used in the vbscript language to convert the specified expression into a date type value?

528


How are values assigned to string type and numeric type variables?

542


Which function is used to perform string comparison?

568






Explain about adodb.stream class?

595


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

1873


What is the difference between vbscript and vba?

607


Both Static and dynamic arrays are handled by VB script. Is it true?

614


What is Procedure or Subroutine in VB Script?

606


How to capture a runtime error in vbscript?

630


Why to use option explicit in vb script?

602


Write a vbscript procedure that converts feet to inches. Hint: there are 12 inches in a foot?

582


What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?

489


what is the features of visual basic?

1556