自己写的一个函数,各位兄弟姐妹帮忙看下

草原可可 2007-05-22 03:28:10
怎样实现下面这个函数只输出前20个,并且按照(共"&sCount&"站)中的sCount从小到大输出。谢谢各位了
function oneline(a,aa,b,bb,startTag,EndTag,m)
dim p,n,c,o,f,ano,bno,statnum,statnum1,str1,Lcount,sline,sCount,exst,str2,qishi1,zhongdian1,qishi2,zhongdian2,www
'取得所有经过起始点的线路
for p=0 to ubound(a)-1
'取得其中的某条线路分割出各个站点
ano=aa(p)
r=split(a(p),"-")
qishi1=r(0)
zhongdian1=r(ubound(r))
'取得所有经过b点的所有线路
for n=0 to ubound(b)-1
bno=bb(n)
if cstr(bno)<>cstr(ano) then
'取得经过某条信路上所有站点
c=split(b(n),"-")
qishi2=c(0)
zhongdian2=c(ubound(c))
'遍例两个数组中看是否有相同的站点,有就读出来,没有就算了
statnum=0
Lcount=0
sCount=0
exst=false
for f=0 to ubound(r)-1
for o=0 to ubound(c)-1
if trim(r(f))=trim(c(o)) then
If trim(startTag)<>trim(r(f)) then
statnum1=getLineCount(startTag,trim(r(f)),a(p))+getLineCount(trim(r(f)),EndTag,b(n))
if Lcount=0 then
sCount=statnum1
Lcount=Lcount+1
exst=true
str1="(共"&sCount&"站)</b></font><br>"+aa(p)&"("&qishi1&aaa(p)&zhongdian1&aaaa(p)&")"&"最新更新时间:"&aaaaa(p)&"<br>"&getMidLine(startTag,trim(r(f)),a(p))&"<br>"&"转"&bb(n)&"("&qishi2&aaaa(p)&zhongdian2&aaa(p)&")"&"最新更新时间"&aaaaa(p)&"<br>"&getMidLine(trim(r(f)),EndTag,b(n))&"<br>"
end if
if Cint(sCount)>Cint(statnum1) then
exst=true
sCount=statnum1
str1="(共"&sCount&"站)</b></font><br>"+aa(p)&"("&qishi1&aaa(p)&zhongdian1&aaaa(p)&")"&"最新更新时间"&aaaaa(p)&"<br>"&getMidLine(startTag,trim(r(f)),a(p))&"<br>"&"转"&bb(n)&"("&qishi2&aaaa(p)&zhongdian2&aaa(p)&")"&"最新更新时间"&aaaaa(p)&"<br>"&getMidLine(trim(r(f)),EndTag,b(n))&"<br>"
end if
end if
end if
next
next
if exst=true then
m=m+1
str2=str2&"<font color='#0000FF'><b>第"&m&"种方案---转达一般车"
str2=str2+str1
end if
end if
next
next
oneline=str2
end function
...全文
131 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
草原可可 2007-05-22
  • 打赏
  • 举报
回复
这样好看一点,帮帮我啊


function oneline(a,aa,b,bb,startTag,EndTag,m)
dim p,n,c,o,f,ano,bno,statnum,statnum1,str1,Lcount,sline,sCount,exst,str2,qishi1,zhongdian1,qishi2,zhongdian2,www
'取得所有经过起始点的线路
for p=0 to ubound(a)-1
'取得其中的某条线路分割出各个站点
ano=aa(p)
r=split(a(p),"-")
qishi1=r(0)
zhongdian1=r(ubound(r))
'取得所有经过b点的所有线路
for n=0 to ubound(b)-1
bno=bb(n)
if cstr(bno)<>cstr(ano) then
'取得经过某条信路上所有站点
c=split(b(n),"-")
qishi2=c(0)
zhongdian2=c(ubound(c))
statnum=0
Lcount=0
sCount=0
exst=false
for f=0 to ubound(r)-1
for o=0 to ubound(c)-1
if trim(r(f))=trim(c(o)) then
If trim(startTag)<>trim(r(f)) then

statnum1=getLineCount(startTag,trim(r(f)),a(p))+getLineCount(trim(r(f)),EndTag,b(n))
if Lcount=0 then
sCount=statnum1
Lcount=Lcount+1
exst=true
str1="(共"&sCount&"站)</b></font><br>"+aa(p)&"("&qishi1&aaa(p)&zhongdian1&aaaa(p)&")"&"最新更新时

间:"&aaaaa(p)&"<br>"&getMidLine(startTag,trim(r(f)),a(p))&"<br>"&"转"&bb(n)&"("&qishi2&aaaa(p)&zhongdian2&aaa(p)&")"&"最

新更新时间"&aaaaa(p)&"<br>"&getMidLine(trim(r(f)),EndTag,b(n))&"<br>"
end if
if Cint(sCount)>Cint(statnum1) then

exst=true
sCount=statnum1
str1="(共"&sCount&"站)</b></font><br>" +aa(p)&"("&qishi1&aaa(p)&zhongdian1&aaaa(p)&")"&"最新更新时

间"&aaaaa(p)&"<br>"&getMidLine(startTag,trim(r(f)),a(p))&"<br>"&"转"&bb(n)&"("&qishi2&aaaa(p)&zhongdian2&aaa(p)&")"&"最

新更新时间"&aaaaa(p)&"<br>"&getMidLine(trim(r(f)),EndTag,b(n))&"<br>"
end if
end if
end if
next
next
if exst=true then
m=m+1
str2=str2&"<font color='#0000FF'><b>第"&m&"种方案---转达一般车"
str2=str2+str1
end if
end if
next
next
oneline=str2
end function

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧