Calling Procedures

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email

To call procedures, include the name of the procedure in a command. If you are calling JScript procedures from VBScript, you must use parentheses after the procedure name, if the procedure has no arguments, use empty parentheses. If you are calling either VBScript or JScript procedures from JScript, always use parentheses after the procedure name. For VBScript, you can also use the Call Keyword when calling a procedure. However, if the procedure that you are calling requires arguments, the argument list must be enclosed in parenthesis. If you omit the Call Keyword, you also must omit the parenthesis around the argument list. If you use Call syntax to call any built in or user defined function, the function's return value is discarded.

The following example illustrates creating and calling procedures by using two different scripting languages (VBScript and JScript)

<%@ LANGUAGE VBSCRIPT>%
<HTML>
<BODY>
< %Call Echo % >
<BR>
<% Call Print Date() %>
</BODY>
</HTML>
<%
Sub Echo Response. Write "<TABLE>" Response. Write "<TR><TH>Name</TH><TH>Value</TH></TR>" Set Params = Request. Query String
For Each p in Params
Response. Write "<TR> <TD>" & p & "</TD> <TD>"
Params(p) & " < /TD > < /TR >
Next Response. Write " < /TABLE >
End Sub
%>
<SCRIPT LANGUAGE = JScript RUNAT = Server>
function Print Date()
{
Var x
x = new Date()

Response. Write (x. to String())
}
</SCRIPT>



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.