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 how you can call vbscript functions?
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.
how to check whether link is disabled in QTP??
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
What is vbscript procedures?
How will you format a number in percetage format in vbscript?
How will you convert a string to upper case string using vbscript?
Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.
Mention what is variant in vbscript?
what is the standards used for writing the script in QTP
Explain about scrrun.dll?
What are class variables?
Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.
What are the 2 ways in which a variable can be declared in the vbscript language?