可以用vb的自定义数据类型来实现,比如双向链表: Type TestType ItemID as Long PreviousID as Long NextID as Long ItemValue as String '可以定义为自己需要的数据类型,也可以定义多个值 End Type定义数组,比如: dim test(100) as TestType然后: for i=0 to 99 test(i).ItemID=i if i=0 then test(i).PreviousID=i else test(i).PreviousID=i-1 endif if i=99 then test(i).NextID=i else test(i).NextID=i+1 endif next
用了双向链表来保存节点数据
Type TestType
ItemID as Long
PreviousID as Long
NextID as Long
ItemValue as String '可以定义为自己需要的数据类型,也可以定义多个值
End Type定义数组,比如:
dim test(100) as TestType然后:
for i=0 to 99
test(i).ItemID=i
if i=0 then
test(i).PreviousID=i
else
test(i).PreviousID=i-1
endif
if i=99 then
test(i).NextID=i
else
test(i).NextID=i+1
endif
next