Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > Re: Pick list w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 1059 of 1118
Post > Topic >>

Re: Pick list with size > 64K

by "Jason Burgon" <jaynews@[EMAIL PROTECTED] > Oct 25, 2007 at 06:02 PM

"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
 




 6 Posts in Topic:
Pick list with size > 64K
eljainc <eljainc@[EMAI  2007-10-24 16:42:55 
Re: Pick list with size > 64K
Marco van de Voort <ma  2007-10-25 07:45:08 
Re: Pick list with size > 64K
"Jason Burgon"   2007-10-25 18:02:51 
Re: Pick list with size > 64K
"Dr Engelbert Buxbau  2007-10-29 09:39:04 
Re: Pick list with size > 64K
Marco van de Voort <ma  2007-10-29 15:47:00 
Re: Pick list with size > 64K
Jim Leonard <MobyGamer  2007-10-29 11:33:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 16:00:46 CDT 2008.