I need to fill User Defined Type arrays in one form and then pass one of the arrays to another form. Currently I am using Public variables to do this but that limits the reusability of the code. For example, the second form may hold an MSFlexGrid that displays all the data in the UDT array. I may have 10 different arrays. I'd like to be able to pass any one of them to the second form. This is very difficult to do with global variables. There must be a better way. Here is the UDT definition in a code module: Type DataElement Location as Single Value as Single Comment as String End Type Here is the declaration in Form1: Dim DataArray(100) as DataElement Dim SecondArray(100) as DataElement then the arrays get filled: For i = 1 to 100 DataArray(i).Location = i DataArray(i).Value = 5 * i DataArray(i).Comment = Str$(i) SecondArray(i).Location = rnd() SecondArray(i).Value = 3.14159 SecondArray(i).Comment = "Test" + Str$(i) Next i Sometimes I want to pass DataArray to another form. Another time I may want to pass SecondArray. I want to be able to read all the data in the array and change it, then pass it back to the calling form.
## Deliverables
Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.
## Platform
Visual Basic 6