IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
VB.Net
Search VB.Net Group:

Advanced
-Collapse +Expand VB.Net To/From
To/FromCODEGuides
-Collapse +Expand VB.Net Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingVB.Net   Print This     
  From the September 2009 Issue of Prestwood eMag
 
VB.Net Parameters (ByVal, ByRef)
 
Posted 16 years ago on 11/15/2008 and updated 1/21/2009
VB.Net Code Snippet:
 A flashcard from our VB.Net Flashcards Library
 A code snippet from our VB.Net Code Snippets Page
 Tags: VB.Net , Parameters

KB101629

VB.Net Parameters

By Reference or Value
For parameters, you can optionally specify ByVal or ByRef. ByVal is the default if you don't specify which is changed from VB Classic (in VB Classic, ByRef was the default).

Syntax Example:
Private Function Add(ByRef a As Integer, _
ByRef b As Integer) As Integer
  Add = a + b
End Function

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P146A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile


Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Intermediate

1 Intermediate Level Question

Question #1: Multiple Choice

Which of the following statements best describes by value and by reference parameters?

Answer:
1. 

For parameters, you can optionally specify ByVal or ByRef. ByRef is the default if you don't specify.

2. 

For parameters, you can optionally specify ByVal or ByRef. ByVal is the default if you don't specify.

3. 

For parameters, you must specify either Val or Ref. There is no default.

4. 

For parameters, you can optionally specify Val or RefRef is the default if you don't specify.

5. 

For parameters, you can optionally specify Val or Ref. Val is the default if you don't specify.


 KB Article #101629 Counter
8833
Since 11/15/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]