how do you make the variable declaration mandatory?what is the use of "option explicit"?
Answers were Sorted based on User's Feedback
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 |
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 |
what is the purpose of the Reporter.ReportEvent in QTP and also please give the brief description about Reporter.ReportEvent ?
write a vbscript for traffic signal
How will you get the octal value of the given number in vbscript?
Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.
What is Querystring collection?
How to Convert Hex color code to color name in VB Script?
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
how to write basic programs in VB Script like addition, multiplication?
How are arrays declared in the vbscript language?
How to write Descriptive programming in .VBS file i wrote this code but it is giving error.. Dim qtApp set qtApp=createobject("QuickTest.Application") qtApp.Launch qtApp.Visible=True Set objIE = CreateObject("InternetExplorer.Application") objIE.visible = True objIE.Navigate "www.gmail.com" browser("title:=gmail").title("title:=gmail")
about vb scripting programs this type of all question& answers
Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..