Bear with me... I'm going to work through an issue in my head here and I hope someone might have some additional opinions that might give me a little better understanding. Thanks in advance.
I'm working on a project right now that requires a significant amount of text to be available to the program for display. I have chosen to put all the text into DATA statements, and then use a small subroutine to load all the text into a string array.
It works beautifully, but I am noticing that it is chewing through my stack space. So far I have 33% of all the required text in DATA statements, but my stack space has been cut in half with just the 1/3 of text I need. I still have enough PROGRAM space, I think, to finish the project.
1) I don't mind hitting a disk for the data, but I only want to do it once. This means that the stack space will still have to absorb all this text into the string arrays, and we will probably run out of stack space.
Example of #1: (text on disk pulled into a string array)
Initialize Open disk file Read all text from disk and feed it into a text array Close disk file Begin Program Display Text from string arrays End Program
In this scenario we save PROGAM space, but not STACK space.
2) I COULD read the text directly from the DATA statements and bypass the use of string arrays. This, however, would require that all the DATA is in my program at all times, and would significantly cut down on my PROGRAM space.
Example of #2: (text read from DATA statements and displayed as needed)
Initialize Begin Program Display text from DATA statements as needed using RESTORE End Program
In this scenario, we save STACK space, but not program space
Perhaps there is something I missed here... Any thoughts?
Edited by Opry99er, Mon Jan 8, 2018 11:49 AM.