I'm learning about classes in VB using the book" VISUAL BASIC LANGUAGE DEVELOPERS HANDBOOK" and they show an example of a stack class that is missing something or I'm not understanding something.
the StackItem class has code as follows:
Public Value As Variant
Public NextItem As StackItem ' this I don't understand - what is this actualy setting up ????
the Stack class (just showing the push method for now) is as follows:
Public Sub Push(ByVal varText As Variant)
Dim siNewTop As StackItem
Set siNewTop = New StackItem
siNewTop.Value = varText
Set siNewTop.NextItem = sitop '''' problem
Set sitop = siNewTop
dim stktest as Stack
set stktest = New Stack
there is no declaration for sitop anywhere in the code and the program errors on that line:
Set siNewTop.NextItem = sitop