Far too big and containing mostly irrelevant stuff to send whole project. Attached is a module with the code that's relevant.
I want to be able to load data from a very large text file in to an array. I want the array to be persistent for access by other procedures.
In the attached module, the get_data() reads the text file, parsing it to elements within the array tracedata() which is dynamically re-dimmed depending on the constituents of the text file (it's seismic positioning data).
The Draw_the_lines() sub uses the data to draw the track of the seismic equipment on a form and calculate some attributes en route.
There will be other subs required in the final program so I don't want to have to re-read the data in to an array each time.
The file attached and not a graphic it has been renamed to allow attachment: please rename to .bas.
Attachments are only available to registered users.
In the attached module, the get_data() sub reads a text file, parsing it to elements within the array tracedata() which is previously and dynamically re-dimmed depending on the constituents of the text file (it's seismic positioning data).
The file, justanswer.bas has been uploaded to the wikisend url
My apologies. I am not familiar with this version and opting out for other Professionals to answer. Please wait. You will be notified by email as soon as any Professional joins you. I will help you with your other questions though. Thank you for your patience.
Just tried that now and it doesn't like it. The shared word is automatically erased as soon as I leave the line. Never seen that before. Usually goes red, beeps at me and puts up a messagebox if it doesn't like something.
The code I uploaded to the wikisend URL contained the sections that are relevant.
I'm just prototyping for an application that I'm planning. As it stands, The declarations, the procedure to dimension the array and then populate it and the procedure that attempts to use the array are all in the same module. The array appears as undimensioned when an attempt to use it is made in the second procedure. I could live with the array scope only being available across the one procedure but would prefer it if it could be made available outside to other modules.
I don't know if it's relevant but the array is extremely large.
OK, well you should have the code as I have, as stated previously, uploaded it to the wikisend URL as initially directed.
The array in question is named tracedata.
I had placed everything in one module to try to make it work prior to you suggesting this. The uploaded data is a single module.
The difference between global and public that you have told me about is interesting but not relevant in this case as I have placed everything in to the same module and the associated form just activates the procudre in the module.
I don't think that it is fully a scope issue. I've been playing around with the problem this evening using a small array and some dummy data and the array is seen in other procedures as expected. I think the problem I've been having is connected to the size of the array. In my prototype the tracedata() array is redimensioned as tracedata(2159, 12, 654, 2), following a data snooping run to check the requirements, and has to be set as LONG as there is insufficient memory otherwise: I have to multiply coordinates, which are to one decimal place, by ten to make them LONG to restrict the memory required.
Is memory requirement close to the limit likely to affect scope?