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

Explain sga memory structures?

1037


what is resorceallocation

2231


what is used of Property........End Property loop ? how to write the script for it?

2259


Which operator is used to concatenate the 2 values in the vbscript language?

1014


In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?

2478


What are the uses of vb script?

1042


Explain the string concatenation function in vbscript?

1050


I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..

2234


How are comments handled in the vbscript language?

1004


Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?

977


Mention when to use function procedures and what are its characteristics?

1123


How to delete a cookie using vbscript?

1158


How to open browser in vb script?

1254


How to get the length of the string by making use of the string function?

1085


write a program to display configuration of a local system with the help of vb script.

2130