| 11.1 Creating Your Own Functions
The general format of a function is as follows: Public Function functionName (Arg As dataType,..........) As dataType or Private Function functionName (Arg As dataType,..........) As dataType * Public indicates that the function is applicable to
the whole program and |
|
||
|
|
|
| Example 11.2
The following program will automatically compute examination grades based on the marks that a student obtained.
|
Public Function grade(mark As Variant) As String
Private Sub compute_Click() grading.Caption = grade(mark)
|