On Wed, 5 Apr 2023 at 16:49, Fischlin Andreas wrote:
TYPE PVECTOR = POINTER TO ARRAY [1..MaxV] OF REAL;
But then all your vectors have to be of the same length even though you could use that type just as well for any vector with a length up to MaxV.
I would rather put that array declaration into a record type and add a length field.
TYPE Vector = POINTER TO RECORD
length : CARDINAL;
values : ARRAY [1..MaxV] OF REAL
END; (* Vector *)
Statically declared, dynamically allocated, dynamically bounded.
This way you can use it for vectors of different sizes as long as the length doesn't exceed MaxV.
PS: All uppercase identifiers should probably be avoided ;-)
regards
benjamin