Results 1 to 5 of 5

Thread: How to differentiate ByVal and ByRef [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    http://www.vbforums.com
    Posts
    164

    Thumbs up How to differentiate ByVal and ByRef [RESOLVED]

    Hi all,

    I'm a bit confused by these by value and by reference. Can anyone show me an example of using this two? I can't differentiate them.

    For example, is the following call byref or byval?

    VB Code:
    1. Private sub Form_Load
    2. dim blnCorrect as boolean
    3.  
    4.     call TrueOrFalse(blnCorrect)
    5.     if blnCorrect = True then
    6.            msgbox "True"
    7.     else
    8.            msgbox "False"
    9.     end if
    10. End Sub
    11.  
    12. Private sub Passing(a as boolean)
    13.     .....
    14.     .....
    15.     a = Not a
    16. End Sub

    Please advice.

    Regards,
    Jeremy
    Last edited by jeremy_ckw; Apr 22nd, 2003 at 03:36 AM.
    "If ignorance is bliss, that probably explain why I'm in a such a mess right now!!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width