| You are here: | About>Computing & Technology>Visual Basic> Learn VB.NET> Procedures in VB.NET |
![]() | Visual Basic |
Procedures in VB.NETExploring the ways procedures are usedAt first glance, this may seem like a fairly trivial operation. After all, what we're talking about is simple code like this: Calling the procedure ... Dim TestArgument As String = "ABCDEF" The procedure definition ... Sub TestSubroutine( _ But there are a host of complications that can come up in the real world. For example, what if the parameter that is passed is an array or a array? What if it doesn't have a fixed number of elements? How do you pass optional parameters? And there is a lot of additional code that can be used in procedures that isn't shown in our simple example. Since one of the fundamental rules of Visual Basic is that every line of code must be inside some sort of procedure, it's important that we get this right. There are several types of procedures to choose from, however. In addition to Sub procedures (which is the focus of most of this article), there are Function procedures, property procedures (Get and Set), and the somewhat obscure Operator procedure. First, the terms argument and parameter are constantly misused, so let's clear that up. According to Microsoft, the procedure call statement contains arguments. (TestArgument above.) The procedure itself defines zero or more parameters. TestParameter is the only parameter defined above. |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |


