Visual Basic 实用技术汇总
1. 创建链表
在编程中,使用链表来创建、管理和重新排序一系列数据是 C 编程的强大工具。在 C 语言里创建数据结构链表时,需要依靠指针变量来保存链表中链接成员的地址。而 Visual Basic 没有显式的指针变量,但它提供了自己的方法来处理对象和变量的引用。
1.1 操作步骤
- 启动一个新项目。
- 在空白窗体中添加一个名为
cmdBuildList的命令按钮。 - 添加以下代码:
Option Explicit
Private colWords As New Collection
Sub Insert(V As Variant)
Dim i As Variant
Dim j As Variant
Dim k As Variant
'Determine whether this is first item to add
If colWords.Count = 0 Then
colWords.Add V
Exit Sub
End If
'Get the range of the collection
i = 1
j = colWords.Count
'Determine whether this should be inserted before first item
If V <= colWords.Item(i) Then
colW
超级会员免费看
订阅专栏 解锁全文
7

被折叠的 条评论
为什么被折叠?



