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 increase the values in text box in a given text box increament by two values by clicking on button
Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com
How do i automate a website www.flyashx.com without having any test cases witin a week time.
What are class events?
how to automatically update the sql server2005 database records when insert in vb6?
How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.
How strcomp function works?
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
how to operate webobjects in a webpage using getobject function and then using generic methods?
What is the event handling in vbscript?
what is the use of QCUtil? explain with one example?
How will you get a random number between 0 and 1 in vbscript?
How many types of procedures are available in the vbscript language?
How many types of operators are available in the vbscript language?
What are string functions in vbscript?