回 帖 发 新 帖 刷新版面

主题:编错误,大家可以进来看下

源代码:
_____________________________________________________________________________
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<script runat="server">
    sub page_load(obj as object,e as eventargs)
        dim m,n As integer
        dim total as Long
        m=3
        n=5
        call pingfanghe(m,n,total)
        message.text="3到5的平方和是:"% cstr(total)
    end sub
    sub pingfanghe(byval a as integer,byval b as integer byref sum as Long)
        dim i as integer
        for i=a to b
        sum =sum +i^2
        next
    end sub

</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
    <asp:label id="message" runat="server"/>

</body>
</html>
____________________________________________________________________________
“/www”应用程序中的服务器错误。
--------------------------------------------------------------------------------

编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误信息: BC30057: “Public Sub pingfanghe(a As Integer, b As Integer)”的参数太多。

源错误:



行 6:          m=3
行 7:          n=5
行 8:          call pingfanghe(m,n,total)
行 9:          message.text="3到5的平方和是:"% cstr(total)
行 10:     end sub


源文件: E:\My Documents\网站\chuanyi.sovf\2-6.aspx    行: 8
____________________________________________________________________________



回复列表 (共1个回复)

沙发

public sub pingfanghe(byval a as integer,byval b as integer,byref sum as Long)


你少写了一个逗号

我来回复

您尚未登录,请登录后再回复。点此登录或注册