I have the following record in some Ada code:
type My_Type (Width, Height : Positive) is
record
Data : array (1 .. Height) of String (1 .. Width);
-- Some other stuff
end record;
Of course I can't have anonymous arrays in my record, but I can't come up with a way to name the array beforehand.
I know that I could make the package depend on width and height to redefine the string of the correct length and name an array of them, but that makes it clunky to have many different sized records at once (which I want).
Does anybody know of a more elegant solution to the problem?
Note: a 2-D array of characters would work, but only if I could extract strings from it in a straightforward way, which is again something I'm not sure how to do.