定义一个Node.cls类文件
Public Data As String Public NextNode As Node |
应用示例
Private Sub Command1_Click() Dim a As Node, b As Node, c As Node Set a = New Node Set b = New Node Set c = New Node a.Data = “123” b.Data = “456” c.Data = “789” Set a.NextNode = b Set b.NextNode = c Set c.NextNode = Nothing Dim d As Node Set d = a MsgBox d.Data Set d = a.NextNode MsgBox d.Data Set d = a.NextNode.NextNode MsgBox d.Data End Sub |