Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 25th, 2003, 10:36 AM
Registered User
 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Arrays seem to be passed byRef always

Even though VB.NET passes parms byVal as the default, I just realized that with arrays, they're always passed as references regardless of whether you specify byVal or byRef in the receiving function. Is there anything in the Fast Track or Professional VB.NET 2nd edition that spells this out? I was surprised that as much as I had read about the change from byRef to byVal as the default going from VB6 to .NET, I missed this.

I'm glad it's this way, though, since C/C++ work the same way, i.e. an array name is really a pointer to the array, so any operation on the array in a function it's passed to works on the original, not just a local copy in the function it's passed to.






Similar Threads
Thread Thread Starter Forum Replies Last Post
ByRef Argument! Apocolypse2005 Beginning VB 6 11 August 9th, 2007 02:21 PM
ByRef property rolandatem VB.NET 2002/2003 Basics 1 October 8th, 2005 08:42 AM
byRef ? g2000 Classic ASP Basics 0 August 18th, 2005 09:37 AM
ByRef and ByVal kgs51 Beginning VB 6 2 November 2nd, 2004 08:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.