Changes

Jump to: navigation, search

Visual Basic Modules and Procedures

418 bytes added, 20:32, 31 July 2007
Defining Visual Basic Subroutines
We are now going to add a subroutine called ''DisplayResult'' to this module. For syntax for a Visual Basic subroutine is as follows:
''scope'' Sub ''subroutineName(parameters)''<br>
End Sub
 
The ''scope'' value is either ''Private'' or ''Public'' depending on whether the Subroutine is to be accessible from Visual Basic code outside of the current module. ''Sub'' is the Visual Basic keyword which indicates this is a Subroutine rather than a Function. ''subroutineName'' is the name of the function. The ''parameters'' value allows the parameters accepted by this Subroutine to be declared (see below).
The ''Public'' keyword indicates the ''scope''. This defines whether this subroutine is accessible from Visual Basic code residing in other modules. Setting the ''scope'' to ''Private'' would make the Subroutine inaccessible to Visual Basic code outside the current module.

Navigation menu