Say i have a class called TMachine I currently create 1 class like so
Machine := MachineShape.TMachine.create(self);
but I need more then 1, never really sure how many i need as it depends on # of machines in the database at the time, Should never be over 20. So I know i need an array of some type in the var section. Currently i have
procedure TFLayout1.GetClick(Sender: TObject);
var
machine : TMachine;
begin
.....
//gets number of machines in total
while not fdeptlayout.ADOQuery1.Eof do
begin
fdb.count := fdb.count+1;
fdeptlayout.ADOQuery1.Next;
end;
//restarts back at first query
fdeptlayout.ADOQuery1.First;
//creates the shape
while not fdeptlayout.ADOQuery1.Eof do
begin
machine := MachineShape.TMachine.Create(self);
machine.PlaceShape(44,44,'CM402','first','123/33/123');
fdeptlayout.ADOQuery1.Next;
end;
end;
currently that will place 1 machine on the form "Machine" . I Need it to place "Machine1" "Machine2" ... for how ever many are in the query. Thus "machine" needs replaced by an array some how? everything is created at runtime.