Professional Documents
Culture Documents
Subroutines. A subroutine is a procedure that does not return a value to the caller. .
Parameters. A parameter is an ASP value that is passed to the procedure for the
purpose of completing a task. ...
Calling Procedures.
Functions
A function is a procedure that returns a value back to the caller. The “caller” is
where the procedure was invoked from. Functions are created (declared) using the
Function statement and terminated with an End Function statement.
<%
Area = l * w
End Function
%>
While this function returns data, there is no requirement for this to occur. You can
declare this function anywhere in your web page and it will be made available for
you to call from anywhere within the page.
Subroutines
A subroutine is a procedure that does not return a value to the caller. Subroutines
are declared using the Sub statement and terminated with an End Sub statement.
<%
Sub ShowDate
Response.Write("Today's Date is: ")
Response.Write(Now())
End Sub
%>
In this example, we have a subroutine that will simply write the string and current
date/time information on the screen. Unlike the function, no value is returned back
to the calling process. A subroutine may or may not have parameters passed.
Parameters
A parameter is an ASP value that is passed to the procedure for the purpose of
completing a task. Parameters can either be passed ByVal (by value) or ByRef (by
reference). If you pass the parameter by value, any changes to the parameter within
the procedure, will not be reflected in the original argument.
If you pass your parameter ByRef, then any changes to the parameter update the
original argument. If you want to pass your parameters ByRef, you must include
the Call statement, when calling the procedure.
<%
Function ProcName (var)
' If the calling process omits "Call", then the parameter is
' passed ByVal. If the keyword "Call" is included, the parameter
' is passed ByRef.
End
The fully qualified name of a class is constructed by concatenating the names of all
the namespaces that contain the type. For e.g. the fully qualified name of the
TextBox class is System.Windows.Forms.TextBox . That means TextBox class is
contained in the Forms namespace that is contained in the Windows namespace
that is contained in the root System namespace.
Private Assemblies
Private assembly is intended only for one application. The files of that assembly
must be placed in the same folder of the application.
Shared Assemblies