- 推广分
- 0 分
- 金豆子
- 173 粒
- 交易币
- 11 枚
- 注册时间
- 2008-8-12
- 阅读权限
- 30
- 帖子
- 62
- 主题
- 32
- 精华
- 2
- UID
- 2011
 
- 交易币
- 11 枚
- 金豆子
- 173 粒
- 推广分
- 0 分
- 帖子
- 62
|
发表于 2008-8-12 20:51:48
|显示全部楼层
ASP简单循环语句
-
- 1.for-next
- for i=1 to 10 set 3
- ...
- next
- 2.for each-next
- for each varelement in objarray
- ...
- next
- varelement为:每一次从数组取出的数
- objarray为:数组对象
- for each与next之间的代码不断地重复执行,直到所有的元素被一一取出。
- 例:
- dim intArray(10)
- dim intElement,i
- for i=1 to 10
- intArray(i)=intLoop*5
- next
- for each intElement In intArray
- response.write(intElement & "")
- next
- 3.While-wend
- While Condition
- ...
- Wend
- Conditon为true下一次循环才会被执行
- 4.Do-Loop
- Do [while/Until (Condition)]
- ...
- Loop [While/Until (Condition)]
- (1)若是条件放在前,先判断再执行;反之则先执行在判断。
- (2)while为条件成立时执行,Until则表示循环执行直到条件成立。
- 5.强制终止循环
- Exit Do/For
复制代码 |
asp, asp, asp, asp, asp, asp, asp, asp, asp, asp, asp, asp, asp, 教程, 新手, 学习, 语句
|