Answer the question
In order to leave comments, you need to log in
How to dynamically expand an array?
Hello.
There is the following
TEat = record
EatName: string;
EatCount: integer;
end;
....
var
Eat: Array of TEat;
....
function AddEat(var Eat: TEat; EatName: string; EatCount: integer;): string;
begin
SetLength(Eat,Length(Eat)+1);
Eat[Length(Eat)].EatName:=Eatname;
Eat[Length(eat)].EatCount:=EatCount;
result:='Создан юнит еды '+Eat[length(eat)].EanName+' в количестве '+Eat[Length(eat)].EatCount+' штук.';
end;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question