Software Archive
Read-only legacy content
17061 Discussions

extending array memory

isn-removed200637
252 Views
What is the best way of increasing array size in an application that adds data into arrays from records from input files, to allow for indefinite numbers of records from an indefinite number of files (up to a limit of course), without having to define very large (fixed) array sizes at compile time?
0 Kudos
1 Reply
james1
Beginner
252 Views
Count the number of records and use an allocatable array of whatever you are using to represent each record's information. If you have a fixed length record, just use GETFILEINFOQQ to get the total size so you can determine the number of records, then ALLOCATE then and read them into the newly allocated array.

James
0 Kudos
Reply