The application of ASP's neutron program in the basic teaching course

Source: Internet
Author: User
Program | Basic Tutorials

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.

<%
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>

Calling subroutines that use JavaScript
how to invoke a subroutine written in JavaScript from an ASP.
<%@ language= "JavaScript"%> 
  
Calling subroutines that use VBScript and JavaScript
how to invoke subroutines written in VBScript and JavaScript in an ASP file.
<script  language="javascript" runat="server">function jsproc(num1,num2){Response.Write(num1*num2)}</script>

子程序

ASP源代码可包含子程序和函数:

将<%@ language="language" %>这一行写到

<%@ language="javascript" %>

VBScript与JavaScript之间的差异

当从一个用VBScript编写的ASP文件中调用VBScript或者JavaScript子程序时,可以使用关键词"call",后面跟着子程序名称。假如子程序需要参数,当使用关键词"call"时必须使用括号包围参数。假如省略"call",参数则不必由括号包围。假如子程序没有参数,那么括号则是可选项。

当从一个用JavaScript编写的ASP文件中调用VBScript或者JavaScript子程序时,必须在子程序名后使用括号。



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.