Click here to Skip to main content
15,913,836 members

Comments by Member 12602897 (Top 4 by date)

Member 12602897 30-Aug-23 10:46am View    
Thank you, thank you, thank you - I was going crazy trying everything but missed that one.
Member 12602897 29-Aug-23 17:59pm View    
In playing with it, I find that when I delete/undo an entry, then add another one, the entry count is the correct number (minus one - plus one). So the process of adding entries and deleting them is working correctly. The problem is that when returning the last entry it only returns the last ADDED one, no matter how many are deleted. It seems I am getting a left-over entry from the add process from somewhere, but not the one at the end of the collection.
Member 12602897 29-Aug-23 13:51pm View    
For the add process an entry is added each time the button is clicked, each entry with a sequential number to make them all different. Teh debugger shows those fields as they are added.

Within the Undo process each time the button is clicked the debugger shows the return for the count of entries in the collection has been correctly decremented, but the data returned for the index (count - 1) is always the same last entry, even though that entry should have been deleted. The debugger shows that the items returned have the data from the last entry that had been added to the collection.
Member 12602897 29-Aug-23 10:57am View    
The return info is in the display field on the form. Each time the btnUndo is clicked it should display the last entry in the collection, then delete/remove that last entry. The next time it is clicked it should show a different / previous last entry. It does not!

I have tried displaying the individual entries from the collection instead of using the "tostring" override, with the same results. I don't know how to look at the data within the collection class itself without accessing an entry and looking at the individual fields in the entry class. Every time I access what should be the last entry in the collection class it appears to be the same data as the original last entry.