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
write a program to display configuration of a local system with the help of vb script.
Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.
What are the disadvantages of vbscript?
How to access array data?
How to take whole text output from screen of Bitmap Application.
regular expression that will recognize a browser as long as its name property starts with mybrowser
What is select case statement?
Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?
How will you get the octal value of the given number in vbscript?
How will you get the natural logarithm of the given number in vbscript?
How to Import data from a file (file is on the desktop) to the data table
I need to get some data from data base and store this
(retrieved) data in a excel sheet using VB script in QTP9.0
I have created connection for data base
I have created as excels sheet by using
Set XL=CreateObject("Excel.Application")
XLworksheet.cells(1,1).value= rs.fields.item("<
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder
Mention what if you do not specify anything when you call a procedure?
When are redim statement and preserve keyword used in the vbscript language?