Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

how to increase the values in text box in a given text box increament by two values by clicking on button

2255


Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com

1534


How do i automate a website www.flyashx.com without having any test cases witin a week time.

1983


What are class events?

1028


how to automatically update the sql server2005 database records when insert in vb6?

2003


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.

2189


How strcomp function works?

1147


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.

1896


how to operate webobjects in a webpage using getobject function and then using generic methods?

3164


What is the event handling in vbscript?

1031


what is the use of QCUtil? explain with one example?

7147


How will you get a random number between 0 and 1 in vbscript?

1386


How many types of procedures are available in the vbscript language?

1049


How many types of operators are available in the vbscript language?

1009


What are string functions in vbscript?

1220