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
how to automatically update the sql server2005 database records when insert in vb6?
Explain the operator precedence in vb script?
How can you create an object in vbscript?
What are class properties?
Can automation testing find ssame no. of bugs what we can find by manual testing?
Which function allows you to instantiate an object given its programmatic identifier or progid?
who will create the object?
Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?
Explain the tristate constants in vbscript?
How to access array data?
How will you get the largest subscript of an array in vbscript?
wht must be the interview question on corinthian information technology solutions incorporated.
Explain the adodb.stream class?
How many types of operators are available in the vbscript language?
Explain the string concatenation function in vbscript?