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

Compare java script and vb script?

1024


What are the rules to name variable in vbscript?

1017


What is byref and byval parameters in vbscript?

1024


How to declare an array in vbscript?

1205


Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?

2433


How can you fetch the value of a cookie?

962


What is vbscript?

1024


What are the special sub-types in vbscript?

986


Explain the constants in vbscript?

932


Difference between dim,public and private variables in vb script?

901


how to check whether link is disabled in QTP??

6049


How to Import data from a file (file is on the desktop) to the data table

1944


what is event handling?

943


How will you get a combined string from array of string in vbscript?

898


What are the differences between sub procedures and function procedures?

931