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

?求求你们了

yangzeng 发布于 2008-08-09 16:05, 486 次点击
Response.Write("<p>Key values:</p>")
a=d.Keys
for i=0 to d.Count-1
  Response.Write(a(i))
  Response.Write("<br />")
next

set d=nothing
%>
这个代码种for i=0 to d.Count-1
能不能只写d.count是求总数,count-1,是什么意思?
2 回复
#2
hikor2008-08-09 16:15
如果是for i=0 to d.Count 那就是循环了 d.count+1次 应为是从0开始的  

你可以写成for i=1 to d.Count或者for i=0 to d.Count-1 都可以
#3
yangzeng2008-08-09 16:42
谢谢你
1