Hi!
I have a class, say TExample, with variables fName, fID, fString ++
I want to make several instances of TExample like this example:
TExamples:
no. 1: fName='test' fID=1 fString='this is a test'
no. 2: fName='3ysdfgh' fID=2 fString='this is a teawegfst'
no. 3: fName='w45y' fID=3 fString='this isasdfgagfa a test'
no. 4: fName='asdfg a' fID=4 fString='this is a teasgst'
i can simply do like this:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
| procedure TEST; var test, test2: TExample; begin test := TExample.Create; test.fname := 'test'; test.fID := 1; test.fString := 'this is a test';
test2 := TExample.Create;
end; |
But what if i don't know how many i shall create?
At runtime, maybe it is one hundred, maybe just one or two.
Can i make an array of TExample? and use the number in the array
as id for each TExample?
Can anyone provide me with a small example of this application please?