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
Mention when to use function procedures and what are its characteristics?
give me any information abou vb script books learn quckly
How to assign a numeric value to a variable?
Mention how to create a cookie using vbscript?
Explain different types of segment?
who will create the object?
Why to use option explicit in vb script?
Explain sga memory structures?
hi i am trying for testing job for 3+ experience(fake) can u suggest me what type of projects i can keep in my resume and how much of knoeledge i should have abt that project.thnks in advance.urgt plz
did any one attended interview in applabs if you had gone through plz tell me the procedure
what is the differance between BYVAL,BYREF?
How will you format a number in percetage format in vbscript?
What is the purpose of folders object of scripting.filesystemobject class in vbscript?
how to acces the remote mechine using vb cript(QTP)
Explain vbscript in detail?