extending array memory

extending array memory

imagem de isn-removed200637

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?

3 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de james@elementyl.com

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

imagem de bruce-michel

I have tried three times to post another method by cutting and pasting a subroutine. Each time the forum software eats some of the line feeds and it ends up garbage.

If anyone is interested in this subroutine which uses a pointer to pointers to dynamically increase the array, contact me directly at Bruce.Michel@honeywell.com

Faça login para deixar um comentário.