What is the difference between ByRef and ByVal.
When to use ByRef and ByVal
Answer Posted / manjunathareddy
ByVal :- Byval is address the actual value of the variable.
Ex:- Function abc(Byval var)
var=var+1
End Function
Dim x:x=2
abc x
Msgbox x
In Above example 2 is the Actual value so it address the
actual value,the Result is 2.
ByRef:- ByRef is address the Location of the Stored variable.
Function abc(ByRef var)
var=var+1
End Function
Dim x:x=2
abc x
Msgbox x
In above example it 2 actual value but in byref it refers
the location of the stored variable the result is 3.
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
Explain sga memory structures?
what is resorceallocation
what is used of Property........End Property loop ? how to write the script for it?
Which operator is used to concatenate the 2 values in the vbscript language?
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
What are the uses of vb script?
Explain the string concatenation function in vbscript?
I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..
How are comments handled in the vbscript language?
Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?
Mention when to use function procedures and what are its characteristics?
How to delete a cookie using vbscript?
How to open browser in vb script?
How to get the length of the string by making use of the string function?
write a program to display configuration of a local system with the help of vb script.