troubleshooting Question

Use of array of a record

Avatar of LeTay
LeTay asked on
Delphi
17 Comments1 Solution476 ViewsLast Modified:
I have defined a type like this (example)

TMyStuff = record
 FirstName:string;
 LastName:string;
 .../...
end;

I want to use in my application a number of such record. The number is not know at design time, just at execution (read external file etc...)

Currently I do this

TAllStuff = record
 Count:integer;
 Stuff:array[1..100] of TMyStuff;
end;

.../...

var
 AllStuff:TAllStuff.

I had to hardcode the size (100) to a value I know will not be overflowed
Isn't there another way, nicer, where I only "create" these records when needed, in a kind of array structure ?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 17 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros