An array with several types?

I was wondering if there is a way to make an array that will have several types of data fields.

So far i have used aMyArray: array of array [0..1] of TPoint;

But now this is not enough for me. I need to add 3 more elements to existing "Point" elements, which makes it an array likeaMyArray: array of (TPoint,TPoint,real,real,real)

Thus, each aMyArray element will have 5 'children', 2 of which are of type TPoint and 3 of them are "real".

Is it possible to implement this?

+3
source share
4 answers

Maybe a record like

TMyType = record
  Points: array[0..1] of TPoint;
  Floats: array[0..2] of Real;
end;

or

TMyType = record
  Point0: TPoint;
  Point1: TPoint;
  Float0: Real;
  Float1: Real;
  Float2: Real;
end;

works for you.

+12
source

Variants . . , .

0

TStringList decendant AddObject.

0
source

You can also use option entries. For an example, see. This

0
source

Source: https://habr.com/ru/post/1744683/


All Articles