Changes

Jump to: navigation, search

Visual Basic Modules and Procedures

711 bytes added, 18:14, 31 July 2007
Defining Visual Basic Functions
== Defining Visual Basic Functions ==
 
Visual Basic Functions differ from Subroutines in that they return a value. The syntax for declaring a Function is as follows:
 
''scope'' Function ''functionName(parameters)'' As ''datatype''<br>
End Function<br>
 
 
The scope value is either ''Private'' or ''Public'' depending on whether the Function is to be accessable from Visual Basic code outside of the current module. ''Function'' is the Visual Basic keyword indcates this is a Function rather than a Subroutine. ''functionName'' is the name of the function. ''parameters'' allows the parameters accepted by this Function to be defined. Finally, ''datatype'' defines the type of value returned by the Function.
 
With this syntax in mind we can create a

Navigation menu