"eljainc" <eljainc@[EMAIL PROTECTED]
> wrote in message
news:1193269375.090796.27550@[EMAIL PROTECTED]
> I have run into a problem.
>
> I have a function in a program that will show a list, and allow the
> user to pick a number from it. The numbers run sequentially, starting
> at 1, 2, 3...
>
> Each item in the list is a string and has a length of 5 (so 6 bytes
> per item). That means that a 64K array will hold approximately 10,921
> items. I want to be able to have over 20,000 items in a similar type
> of list. Clearly, this won't work.
A TStringCollection (from Turbo Vision) will allow you to have up to
16,380
strings. However, this still does not get you your 20,000+ items, and with
such short strings, would be quite inefficient anyway.
I this case I would dynamically allocate blocks of strings (of say 8192
strings each) and then have a TCollection that points to each block of
8192
strings. Your list first selects the appropriate block, then the
appropriate
string[s] within the block.
A little awkward perhaps, but not too difficult, and it would have a
capacity of about 134,184,960 strings.
--
Jay
Jason Burgon - author of Graphic Vision
http://homepage.ntlworld.com/gvision


|