Answer the question
In order to leave comments, you need to log in
Delphi. How to optimize the creation of records in the record class?
I need to implement the creation of records in a record in the most compact way, presumably using functions.
Tried like this:
type
TDrinker = record
firstname: string;
age: integer;
end;
TParty = class
public
function CreateDrinker(Drinker: TDrinker; fname: string; a: integer): string;
var
Vasya: TDrinker;
........
TParty.CreateDrinker(Drinker: TDrinker; fname: string; a: integer): string;
begin
with drinker do
begin
firstname:=fname;
age:=a;
result:='Создан участник '+firstname+' с возрастом '+age;
end;
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