VB list1,list2,list3,list4四个列,怎样按照如下顺序输出到1个TXT中,?

2024-12-05 05:04:53
推荐回答(1个)
回答1:

dim l1 as long,l2 as long,l3 as long,l4 as long
dim i1 as long,i2 as long,i3 as long,i4 as long
dim t1 as long,t2 as long,t3 as long,t4 as long

dim t as string
t=""
l1=list1.ListCount: l2=list2.ListCount: l3=list3.ListCount : l4=list4.ListCount
i1=0: i2=0: i3=0: i4=0
t1=0: t2=0: t3=0: t4=0
do
DoEvents

if i1<=l1 then
t=t & list1.list(i1) & chr(13) & chr(10)
i1=i1+1
else
t1=-1
end if
if i2<=l2 then
t=t & list2.list(i2) & chr(13) & chr(10)
i2=i2+1
else
t2=-1
end if
if i3<=l3 then
t=t & list3.list(i3) & chr(13) & chr(10)
i3=i3+1
else
t3=-1
end if
if i4<=l4 then
t=t & list4.list(i4) & chr(13) & chr(10)
i4=i4+1
else
t4=-1
end if
if t1=-1 and t2=-1 and t3=-1 and t4=-1 then exit do
loop
txt=t