最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp For Each Next 用法与For Each实例教程
时间:2022-07-02 22:33:49 编辑:袖梨 来源:一聚教程网
在For Each ... Next循环类似,对于... Next循环。而不是重复陈述的指定的次数,
每名... Next循环重复的对象集合为数组中的每个元素的声明(或每个项目)。
下面的代码片断创建下拉列表中选择其中一个数组元素:
Select ActionSelect AllTry It<%
Dim bookTypes(7) 'creates first array
bookTypes(0)="Classic"
bookTypes(1)="Information Books"
bookTypes(2)="Fantasy"
bookTypes(3)="Mystery"
bookTypes(4)="Poetry"
bookTypes(5)="Humor"
bookTypes(6)="Biography"
bookTypes(7)="Fiction"
Dim arrCars(4) 'creates second array
arrCars(0)="BMW"
arrCars(1)="Mercedes"
arrCars(2)="Audi"
arrCars(3)="Bentley"
arrCars(4)="Mini"
Sub createList(some_array) 'takes an array and creates drop-down list
dim i
response.write("
Carriage Return and Line Feed
For Each item in some_array
response.write("" &
vbCrLf)
i = i + 1
Next 'repeat the code and move on to the next value of i
response.write("")
End Sub
'Now let's call the sub and print out our lists on the screen
Call createList(bookTypes) 'takes bookTypes array as an argument
Call createList(arrcars) 'takes arrCars array as an argument
%>
相关文章
- 《真三国无双:起源》反击方法 11-25
- 《真三国无双:起源》武艺使用方法 11-25
- 《潜行者2:切尔诺贝利之心》手动存档方法介绍 11-25
- 《潜行者2:切尔诺贝利之心》支线任务盗亦无道攻略 11-25
- 《真三国无双:起源》回避作用分享 11-25
- 《潜行者2:切尔诺贝利之心》战役存档槽作用介绍 11-25