注册 登录
编程论坛 ASP技术论坛

怎么会end function 有问题?

个性人生 发布于 2008-10-27 14:41, 756 次点击
<%
functiom countN(n)
dim i,c,a
a=requst.form("x")
If a<>"" then
a =cint(x)
End if
c=0
for i=1 to a
c=c+i
next
countN=c
end function
response.Write "从 1 加到 " & a & " 的结果是:" &countN(a)
%>
<form name="form1" method="post" >
x=<input type="text" name="x">

'怎么会end function 有问题?没搞懂,,,大家帮我看哈,我是新手哈,正在努力学阶段,

[[it] 本帖最后由 个性人生 于 2008-10-27 14:53 编辑 [/it]]
4 回复
#2
lili06102008-10-27 14:56
你的N有值吗
#3
yms1232008-10-27 14:59
<%
Dim a
a=10
functiom countN(n)
  dim i,c,a
  a=requst.form("x")
  If a<>"" then
     a =cint(x)
  End if
  c=0
  for i=1 to a
     c=c+i
  next
  countN=c
end function
response.Write "从 1 加到 " & a & " 的结果是:" &countN(1)
%>
#4
个性人生2008-10-27 15:08
<%
function countN(n)
dim i,c
c=0
for i=1 to n
c=c+i
next
countN=c
end function
a=requst.form("x")
If a<>"" then
a =cint(a)
End if
response.Write (countN(a))
%>
<form name="form1" method="post" >
x=<input type="text" name="x">

改了一下子,,还是不对

[[it] 本帖最后由 个性人生 于 2008-10-27 15:10 编辑 [/it]]
#5
yms1232008-10-27 15:38
<%
function countN(n)
  dim i,c
  c=0
  for i=1 to n
     c=c+i
  next
  countN=c
end function
Dim a
a=requst.form("x")
If a<>"" then
   a=cint(a)
End if
response.Write countN(a)
%>
1