Wednesday, October 27, 2010

Parameters in Subroutines & Functions

Sometimes a behavior will require further information to accomplish a task. When an input is required for a behavior to execute, this input is passed to the procedure as one or a number of parameters (sometimes called arguments).

Code eg: Subprocedure using parameters.

Public Sub Login(Username As String, Password As String)
    ' Code does something
End Function

Code eg: Function using parameters.

Public Function Calculate(NumberOne As Integer, NumberTwo As Integer) As Integer
    ' Code does something
   Return AValue
End Function

No comments:

Post a Comment