I am storing a class, called History, inside a stack, (or attempting to :sick:)
The class is just the path to files that has been opened before (this is all for
storing file history), the index to the file, and the data for that particular file.
The initialization is done in the Main Form at the top
Then in the loading of the Main Form I am doing this:
Then I load the text file that holds the data, and assign each of the FH items, so that I have something like . .
index = 4,
itemTitle = "C:\Greek\Reading Greek\Reading Greek.rtf"
data = "various string data items"
Everything works great, FH loads well, then as each of these load, I attempt to push
them onto the FileHistoryStack, and it all goes to hell in a handbasket: :eek2:
Inside the loop that loads each FH's items, after they load, I attempt to add FH to
the FileHistoryStack. I have verified that each time the loop reaches here,
the FH data is different, but each time I push something onto the
FileHistoryStack, it replaces ALL THE VALUES on the FileHistoryStack with
the current item being placed on the stack!
So for example, if itemTitle = "C:\Greek\Reading Greek\Reading Greek.rtf", and the
FileHistoryStack already has three items on it, they all change to the item that
is being added. Does anyone know how I can correct this? Thanks in advance . . .
The class is just the path to files that has been opened before (this is all for
storing file history), the index to the file, and the data for that particular file.
The initialization is done in the Main Form at the top
Code:
Public FileHistoryStack As New Stack(Of History)
Public Class History
Property index As Integer
Property itemTitle As String
Property data As String
End Class
Code:
Dim FH As New History
index = 4,
itemTitle = "C:\Greek\Reading Greek\Reading Greek.rtf"
data = "various string data items"
Everything works great, FH loads well, then as each of these load, I attempt to push
them onto the FileHistoryStack, and it all goes to hell in a handbasket: :eek2:
Inside the loop that loads each FH's items, after they load, I attempt to add FH to
the FileHistoryStack. I have verified that each time the loop reaches here,
the FH data is different, but each time I push something onto the
FileHistoryStack, it replaces ALL THE VALUES on the FileHistoryStack with
the current item being placed on the stack!
Code:
FileHistoryStack.Push(FH)
FileHistoryStack already has three items on it, they all change to the item that
is being added. Does anyone know how I can correct this? Thanks in advance . . .