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 |
write a vb script to calculate factorial of a number?
write a vb script to create a folder?
What is the use of the instr function?
Explain How do you create a recordset object in vbscript?
what is the code in QTP to take screen shot? Please send me any one to my mail id. my mailid is manu.sanepalli@gmail.com
Can anybody code this problem for me in VB script - Create an array of 4 elements, increase its size to 7 elements and then find out which of the elements are prime (use functions)
What is the purpose of folders object of scripting.filesystemobject class in vbscript?
hey please tell me how to retriev data from excel sheet which puts the login name and password in the application? plz send me the code..please help me
What is the use of the formatdatetime function in the vbscript language?
Create a file system object to do the following i. Create a folder ii. Create a text file in the folder iii. Update text file with some tex
Can any 1 modify the code whr in want to add\rename a excel sheet in qtp?
about vb scripting programs this type of all question& answers