What is the difference between ByRef and ByVal.
When to use ByRef and ByVal

Answer Posted / sagar mitra

ByRef refers to the location, ByVal refers to the actual value. Also, if you are passing parameters with "ByVal" then even if the parameter values are changed, the original argument values will remain intact. But if you pass using "ByRef" then if the parameter values are changed, then the original argument value is also modified

Is This Answer Correct ?    26 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?

3559


How to capture a runtime error in vbscript?

637


Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP

1878


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

2165


How to add actions in driver script to run those actions in QTP?

1525






Mention what is byref and byval parameters in vbscript?

582


When does ‘on click of button’ event gets triggered in the vbscript language?

553


Which in-built function is used to format the number in the vbscript language?

586


How to write a VBscript for web page performance test i need a code send if any knows the code If any knows VBScript book plz send to me the link to my mail plz

2396


Mention characteristics of sub procedures?

583


How can you fetch the value of a cookie?

552


Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)

1420


What are the naming conventions while declaring a variable in the vbscript language?

624


What is the scope of a constant declared using public?

570


How to write functions and sub in vb script?

627