I have a VB6.0 form that I use to graph data. It maintains an array in its form module that looks like this:
Public Type TraceInfoType
iDevice As Integer
iParameter As Integer
iPlotSubsetIndex As Integer
iColorIndex As Integer
dLastTimeTenthsSec As Long
lSubsetPointer As Long
SubsetWrapped As Boolean
Dim iNumTraces As Integer
Dim Traces(MAXTRACES) As TraceInfoType
Which obviously helps to manage data for my plot control. I have another form that I use for troubleshooting/debugging -- I have an INI setting that invokes it on startup, and it shows a lot of the underlying data in the application so that I can actually get a good idea of the problem outside of the development environment. I thought this was a pretty nifty idea (if I do say so myself)...
Except its capability is severely hampered by the fact that it does not have access to arrays like the Traces array above. If I make the Traces array public, it doesn't compile because I get the error in the subject line. If I leave it private, I can't get to it from other forms. (What I wanted to do was have my debug form extract data periodically from this underlying array in the Chart form and put it in a listbox on its form --just so I can see what's going on)
So the only solutions I see are to:
1) add some public functions to my chart form to extract and return the array data. This stinks, because I'd have to write a lot of code to extract various data structures from various places, which would probably take longer than the effort the debug form would save me.
2) I could move the traces array to a global module and make it public, but this doesn't make any sense because... it belongs in the chart form! It is information that is not useful except to the chart form and should stay there.
Is there any other way to get that data out of my Traces array and into my Debug form?? I saw there is a 'friend' parameter, but couldn't make it work for me...