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

how to set one column as primary key in QTP and fetch values accordingly

2099


what is the features of visual basic?

1785


Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?

791


i wrote vbscripit code in notepad i got error i am in learning stage if u ps tell me what wrong in my code my error is "object required descriptive at line one run time error"and my code is "set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signinobj("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Set secure.Crypt.Encrypt("enter password") browser("gmail").page("gmail").WebButton("siginobj").click

1650


Explain about scrrun.dll in vbscript?

889


What is difference between vbscript and vba?

877


Explain about the support of asp for vb script functionality?

742


When does ‘on click of button’ event gets triggered in the vbscript language?

785


What is the use of the formatdatetime function in the vbscript language?

788


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

763


What's the difference between vbscript and vb.net?

823


What are string functions in vbscript?

872


How will you get a combined string from array of string in vbscript?

757


Write a code to print numbers from 5 to 0?

938


how to comvert 120 into one hunderd twenty rupees only and vice varsa

2044