本文发表在 rolia.net 枫下论坛Hi,freinds. I write a simple code as following:
----------------------------------------------
<%
dim col1(2)
col1(1)=TRIM(Request("col1(1)"))
col1(2)=TRIM(Request("col1(2)"))
col1(1)=cINT(col1(1))
col1(2)=cINT(col1(2))
total1=col1(1)+col1(2)
%>
<html>
<body>
<%=col1(1)%><br>
<%=col1(2)%><br>
<%=total1%><br>
</body>
</html>
-----------------------------------------------
It works. When I input 2 number in the table of another webpage, it gives right answer.
But because the involved row is actually much larger than 2. So I want to use FOR looping
to simplize the code. I write as following:
------------------------------------------
<%
dim col1(2)
col1(0)=0
for i=1 to 2
col1(i)=TRIM(Request("col1(i)"))
col1(i)=cINT(col1(i))
total1=col1(i)+col1(i-1)
next
%>
<html>
<body>
<% for i=1 to 2%>
<%=col1(i)%>
<%next%>
<%=total1%>
</body>
</html>
---------------------------
But it doesn't work.IE displays:"Type mismatch: 'cINT' "Who can tell me how to fix it?
Thanks a lot.更多精彩文章及讨论,请光临枫下论坛 rolia.net
----------------------------------------------
<%
dim col1(2)
col1(1)=TRIM(Request("col1(1)"))
col1(2)=TRIM(Request("col1(2)"))
col1(1)=cINT(col1(1))
col1(2)=cINT(col1(2))
total1=col1(1)+col1(2)
%>
<html>
<body>
<%=col1(1)%><br>
<%=col1(2)%><br>
<%=total1%><br>
</body>
</html>
-----------------------------------------------
It works. When I input 2 number in the table of another webpage, it gives right answer.
But because the involved row is actually much larger than 2. So I want to use FOR looping
to simplize the code. I write as following:
------------------------------------------
<%
dim col1(2)
col1(0)=0
for i=1 to 2
col1(i)=TRIM(Request("col1(i)"))
col1(i)=cINT(col1(i))
total1=col1(i)+col1(i-1)
next
%>
<html>
<body>
<% for i=1 to 2%>
<%=col1(i)%>
<%next%>
<%=total1%>
</body>
</html>
---------------------------
But it doesn't work.IE displays:"Type mismatch: 'cINT' "Who can tell me how to fix it?
Thanks a lot.更多精彩文章及讨论,请光临枫下论坛 rolia.net