×

asp 数组 数组

ASP数组简单排列?ASP数组问题(急)

admin admin 发表于2022-07-26 12:14:37 浏览114 评论0

抢沙发发表评论

求出数组1中没在数组2中出现的值 ’比如:str3=“喷漆,CD“ ’asp中写 str=Split(str1,“, “) str0=Split(str2,“, “) For I = Lbound(str) to Ubound(str) v=0 va=0 do while v《Ubound(str0)+1 if str(I)=str0(v) then va=1 end if v=v+1 loop if va=0 then str3=str3+str(I)+“, “ end if Next response.Write(left(str3,len(str3)-2))ASP数组问题(急)《% dim sql,jsql = “select * from class order by classid “ set rs =killsqlconn.execute( sql ) while not rs.eof j=0 ok=0 if qxidStr 《》 ““ then for i=0 to ubound(qxidStr0) if rs(“classid“)=int(qxidStr0(i)) then ok=1 end if next end if if ok=1 then%》《%=rs(“classname“)%》《br /》 《% end if j=j+1 rs.movenext wend%》asp中变量的声明不是强类型,ASP数组简单排列如str1=“靠垫,喷漆,GPS,精装,CD,皮椅,椅“ 这样子椅就不会显示出来 str1=“靠垫,喷漆,GPS,精装,CD,皮椅“ str2=“精装,GPS,皮椅,靠垫“ sp1=split(str1,“,“) str3=““ for i=0 to ubound(sp1) if instr(str2,sp1(i))=0 then str3=str3&““&sp1(i) if i+1《ubound(sp1) then str3=str3&“,“ end if next response.Write str3 二 这种计算次数过多 有点啰嗦 dim str,str0,str1,str2,str3 str1=“喷漆, GPS, 精装, 靠垫, CD, 皮椅“ str2=“精装, GPS, 皮椅, 靠垫“ str3=““ ’现在要求,声明时用dim显示声明ASP动态数组“%dim wheerist(),str1wheerallist = split(request.querystring,“&”)str1 = join(whereList,“ and”)响应,writestr1%,但我必须提醒您。

ASP数组简单排列


如str1=“靠垫,喷漆,GPS,精装,CD,皮椅,椅“ 这样子椅就不会显示出来
str1=“靠垫,喷漆,GPS,精装,CD,皮椅“
str2=“精装,GPS,皮椅,靠垫“
sp1=split(str1,“,“)
str3=““
for i=0 to ubound(sp1)
if instr(str2,sp1(i))=0 then
str3=str3&““&sp1(i)
if i+1《ubound(sp1) then str3=str3&“,“
end if
next
response.Write str3
二 这种计算次数过多 有点啰嗦
dim str,str0,str1,str2,str3
str1=“喷漆, GPS, 精装, 靠垫, CD, 皮椅“
str2=“精装, GPS, 皮椅, 靠垫“
str3=““
’现在要求,求出数组1中没在数组2中出现的值
’比如:str3=“喷漆,CD“
’asp中写
str=Split(str1,“, “)
str0=Split(str2,“, “)
For I = Lbound(str) to Ubound(str)
v=0
va=0
do while v《Ubound(str0)+1
if str(I)=str0(v) then
va=1
end if
v=v+1
loop
if va=0 then
str3=str3+str(I)+“, “
end if
Next
response.Write(left(str3,len(str3)-2))

ASP数组问题(急)


《% dim sql,j
sql = “select * from class order by classid “
set rs =killsqlconn.execute( sql )
while not rs.eof
j=0
ok=0
if qxidStr 《》 ““ then
for i=0 to ubound(qxidStr0)
if rs(“classid“)=int(qxidStr0(i)) then
ok=1
end if
next
end if
if ok=1 then
%》
《%=rs(“classname“)%》《br /》
《%
end if
j=j+1
rs.movenext
wend
%》
asp中变量的声明不是强类型,声明时用dim显示声明

ASP动态数组

“%dim wheerist(),str1wheerallist = split(request.querystring,“&”)str1 = join(whereList,“ and”)响应。writestr1%。但我必须提醒您,如果您想成为条件的SQL,,字符串必须添加一个引号,例如:city ='suzhou'和list ='上海'和list1 ='nanjing'。-asp 数组