CompuServe Messages

Question on ARRAYs

    26-Jun-90 23:17:11
Fm: Bill Roberts 76056,1613
To: Art Steinmetz 76044,3204
This solution is just the basic solution. You must include error code to insure that the BigArray pointers are properly initialized. This would be a good scheme, though, where the arrays are sparse and clustered. You would allocate a LittleArray when you have data to store in that section, and leave the majority unallocated. Another solution might be to make BigArray an array of character strings which contain the names of files, and the procedure GetElement would handle all the I/O, memory loading, and unloading. This is the strong point of modula. You can make these changes, and do very little recompilation. It might be better to make LittleArrayPtr a private type, then none of the client modules would ever have to be recompiled, no matter how the problem was solved. This module could be put in a library here, and distributed to anyone who wanted to use it.