VBScript Functions and Procedures
VBScript Procedures
There are two kinds of procedures
Sub procedure
Function procedure
Sub procedures
It is enclosed by Sub and End Sub statements.
Performs actions but don't return a value.
Can take arguments, if no, include an empty set of parentheses ()
Syntax:
Calling the Procedure
It can be called from
Another procedure
Function
Control's event in the body section of an HTML file.
Syntax:
DisplayMessage
Passing an Argument
Procedure will take values from outside.
These values are called as “Arguments”.
The number and types of arguments of a procedure depends on various factors.
Example:
Function
Function procedures
Enclosed by the Function and End Function statements.
Similar to a Sub procedure, but can also return a value.
Can take arguments, if no, include an empty set of parentheses ().
Return a value by assigning a value to its name in one or more statements of the procedure.
The return type of a Function is always a Variant.
0 Responses to VBScript Functions and Procedures
Something to say?