In ASP, you can invoke the program from VBScript and other means.
Instance:
Calling subroutines that use VBScript
How to invoke a subroutine written in VBScript from an ASP.
The following are the referenced contents:
<% Sub Vbproc (NUM1,NUM2) Response.Write (NUM1*NUM2) End Sub %>
<body> <p> Can call a procedure as this: </p> <p> Result: <%call vbproc (3,4)%> </p> <p> Or, like this: </p> <p> Result: <%vbproc 3,4%> </p> </body> How to invoke a subroutine written in JavaScript from an ASP. <%@ language= "JavaScript"%> <% function Jsproc (num1,num2) { Response.Write (NUM1*NUM2) } %> <body> <p> Result: <%jsproc (3,4)%> </p> </body>
Calling subroutines that use VBScript and JavaScript How to invoke subroutines written in VBScript and JavaScript in an ASP file. <% Sub Vbproc (NUM1,NUM2) Response.Write (NUM1*NUM2) End Sub %> <script language= "javascript" runat= "Server" > function Jsproc (num1,num2) { Response.Write (NUM1*NUM2) } </script> <body> <p>result: <%call vbproc (3,4)%></p> <p>result: <%call jsproc (3,4)%></p> </body> Sub Programs ASP source code can contain subroutines and functions: <% Sub Vbproc (NUM1,NUM2) Response.Write (NUM1*NUM2) End Sub %> <body> <p>result: <%call vbproc (3,4)%></p> </body> By writing <%@ language= "language"%> this line above the <%@ language= "JavaScript"%> <% function Jsproc (num1,num2) { Response.Write (NUM1*NUM2) } %> <body> <p>result: <%jsproc (3,4)%></p> </body>
|
the difference between VBScript and JavaScript
When you invoke VBScript or JavaScript subroutines from an ASP file written in VBScript, you can use the keyword "call" followed by the subroutine name. If the subroutine requires parameters, you must surround the arguments with parentheses when using the keyword "call". If "Call" is omitted, the argument does not have to be surrounded by parentheses. If the subroutine has no arguments, then the parentheses are optional.
When you call VBScript or JavaScript subroutines from an ASP file written in JavaScript, you must use parentheses after the subroutine name.