I have a project going that is a part excersize to learn the basics of classes, and partly because I would like to use linked lists in another project. I would like create a linked list class from scratch that can create a node as well as perform certain operations to be determined later. I am going by the video tutorials at http://www.youtube.com/watch?v=Ju5q1hhFCso which is a first of 9 tutorials.
Below shows the class Cnode, and below that is a subroutine located in a module that tests the class. The cNode class I copied from either here, or somewhere on the internet. So far the class seems to work, I think. The only part that does not yet seem to work is I cannot set the next of node q to be Null in the text subroutine below. Does anyone have any idea why it is not working?
Option Explicit
'A node takes in 2 things. A data value, and a reference to the next node
Private pData As String
Private pNext As cNode
Public Property Get aData() As String
aData = pData
End Property
Public Property Let aData(Value As String)
pData = Value
End Property
Public Property Get Nxt() As cNode
Set Nxt = pNext
End Property
Public Property Set Nxt(Value As cNode)
Set pNext = Value
End Property
Private Sub cNode(ByRef pData As String, ByRef pNext As cNode)
Me.pData = pData
Me.pNext = pNext
End Sub
Display More