Difference between ByRef and ByVal?

Answer Posted / suresh

Only a copy of a variable is passed when an argument is
passed by value. If the procedure changes the value, the
change affects only the copy and not the variable itself.
Use the ByVal keyword to indicate an argument passed by
value.

Passing arguments by reference gives the procedure access
to the a1ctual variable contents in its memory address
location. As a result, the variable's value can be
permanently changed by the procedure to which it is passed.
Passing by reference is the default in Visual Basic.
If you specify a data type for an argument passed by
reference, you must pass a value of that type for the
argument. You can work around this by passing an
expression, rather than a data type, for an argument.
Visual Basic evaluates an expression and passes it as the
required type if it can.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

To populate a single column value which dbcontrols you to use?

1638


With in the form we want to check all the text box control are typed or not? How?

1613


Explain about the basic features of Visual basic?

659


Parts of ODBC?

1519


Is visual basic case sensitive?

674






Explain Default cursor Type and LockEdits type in RDO?

1555


What's the difference between MODAL and MODELESS forms?

1094


What is the default model of the form?

1694


Write the Steps in Creating an ActiveX Control?

2041


What are 3 main differences between flexgrid control and dbgrid control?

1773


by writing MACRO CODE,i want to retrive data from one spead sheet to another UI (workbook). control will search cell by cell for each row and load the data in another workbook(UI). ex: custdetails custname lastname locaton mobile pincode custdetails raj tony hyd 555555 521245 servcreqrd srvce# srvcename location srvcepincode servcreqrd 754 drilling hyd 521784 for the above example in the another workbook retrive data like this custname Raj srvce# 754 srvcepincode 521784. while retrieving data control will search cell by cell for each row.

1778


What language does visual basic use?

580


What is the use of NEW Keyword? Explain.

1627


How would you create properties in ActiveX Control?

1588


what are the Differenct Types of Procedures in VB?

1529