Hello All,
I am having a bit of a problem with a Structure. What I need to be able to do is loop through my Collection Class and add information about each instance in the Collection to the various elements in the Structure and pass the structure back out of the function. Each element in the Structure is an empty array when it is first created. The function will then redim preserve each element to the correct size and add the information to the Structure as it loops through. The problem is that when I try to access the different elements in the structure Intellisense does not show them to me. I do not undertand what is going on here. Would someone be so kind as to shed some light on this problem. I would be most grateful. This method worked fine in VB6 and was a pretty slick way of passing multiple pieces of data back out of a function. Just pass the Structure instead and I had access to all the data inside the Structure back on the other side, no problem. Although in VB6 it was a Type not a Structure. Here is what the Structure declaration looks like. Any help you can offer would be appreciated. Thanks In Advance.
Public Structure FormItems Dim Name() As String Dim Text() As String Dim Dirty() As Boolean Dim Saved() As Boolean Dim WindowState() As FormWindowState Dim Parent() As Application End Structure
Adding Data To Elements Of A Structure
Nick Doty
Hi Shane. Regardless of if it works or not, it's a really bad way to do things. I would still encourage creating a struct that represents a record, and storing an array of them.
Raconteur971
Prescott
Hi Christian,
Thanks for the response to my post, much appreciated. All the data in each element of the structure is related element 0 is the property values for the first instance in the collection and so on. Does not matter anyway because for some reason, it now appears to be working as it should. Thank you for your suggestion however.
Regards,
V. Shane Curtis