Home > Back-end >  Consulting a problem, how to loop multiple class assignment
Consulting a problem, how to loop multiple class assignment

Time:09-30

For example, I define the class
Type
MyClass class=
B:=integer;
end;


A1, a2, a3, a4... An: MyClass

For I:=1 to n do
A (I). B:=1; Class depends on the way to deal with


The control word can use the
Timage (findcomponent (' image '+ inttostr (I))). The Picture.,,,,,,

CodePudding user response:

Defined as an array of
 type 
MyClass class=
B: integer;
end;


Var
A: array [1.. n] of MyClass.

For I:=1 to n do
A [I]. B:=1;


By the way, remember to Create objects

CodePudding user response:

Define an array,

CodePudding user response:

Define an array at the same time when creating a class for each class to make a class name is convenient for you to visit

CodePudding user response:

Define an array, or to create objects into the TList list container, such as
For I:=0 to the List. Do the Count - 1
MyClass (List [I]). B:=1;
  • Related