A Sub procedure is a series of VBScript statements, enclosed through Sub & End Sub statements which perform actions however don't return a value. A Sub procedure can take arguments (variables, constants or expressions which are passed by a calling procedure). If a Sub procedure contains no arguments, its Sub statement has to include an empty set of parentheses ().
Figure illustrates a Sub procedure uses two intrinsic or built-in, MsgBox, VBScript functions, & InputBox, to prompt a user for some information. Then it displays the results of a calculation depend on that information. The calculation is performed into a Function procedure created by using VBScript. The Function procedure is illustrated after the following discussion.
Sub ConvertTemp()
temp = InputBox("Please enter the temperature in degrees F.", 1)
MsgBox "The temperature is " & Celsius(temp) & " degrees C."
End Sub