请高手回答这个树组怎么循环,,能出来就给20分,刚来这个版快,分不多,谢谢
str1= "2,aaa,45,bbb,3,ccc "
str2=str1.split(str1, ", ")
r=0
for each i in str2
str=str(r) & str(r+1)
response.Write(str+ " <br> ")
r=r+1
next
str1 是树组,我想循环 输出
2 aaa
45 bbb
3 ccc
因为我解决的问题是,要循环插入3条记录
下面是要输出的效果
怎么写那个循环??
insert into emp values(2, 'aaa ')
insert into emp values(45, 'bbb ')
insert into emp values(3, 'ccc ')
------解决方案--------------------如果你要的是这个:
http://www.pifoo.com/myos/uploadfiles/test.asp
请使用如下代码:
<%
'Write by jspadmin
'http://www.pifoo.com
'http://www.jspadmin.cn
str= "2,aaa,45,bbb,3,ccc "
arr=split(str, ", ")
for j=LBound(arr) to UBound(arr)-1 step 2
if arr(j+1) <> " " then '防止数组越界
sql= "insert into employee values( " & arr(j) & ", " " " & arr(j+1) & " " ") "
response.write sql & " <br/> "
end if
next
%>
或者从这下载
http://www.pifoo.com/myos/uploadfiles/test.rar