Board index » delphi » Linked list vs TStringList

Linked list vs TStringList

I am writing a program that will keep an undefined number of records in
memory at one time.  To do this, I have considered the following options:
1)  Write my own linked list logic; 2) Use TStringList. I am not looking
for a great deal of functionality here.  Just a simple way to maintain
these records (add, delete, update, move, etc.).

Questions:  Which method would you recommend?  Have I missed other
options?  What are the pros and cons of each method?  I know that to use
the TStringList I would have to add objects to the list rather than simply
adding records.  Are there any other "overhead" items such as this that I
should know about before I proceed.

Thanks in advance.

Bruce Bukovics

 

Re:Linked list vs TStringList


In article <4av453$...@newsbf02.news.aol.com>
           perigee...@aol.com "PerigeeSY1" writes:

Quote
> I am writing a program that will keep an undefined number of records in
> memory at one time.  To do this, I have considered the following options:
> 1)  Write my own linked list logic; 2) Use TStringList. I am not looking
> for a great deal of functionality here.  Just a simple way to maintain
> these records (add, delete, update, move, etc.).

> Questions:  Which method would you recommend?  Have I missed other
> options?  What are the pros and cons of each method?  I know that to use
> the TStringList I would have to add objects to the list rather than simply
> adding records.  Are there any other "overhead" items such as this that I
> should know about before I proceed.

How undefined?  Is there a sensible upper limit which would allow you to
define an array of pointers?

If you could use an array, you would not incurr the overhead of the
links and their management.

--

regards

Dave Gray                                 Nailsea Bristol UK 01275 857746
Bespoke Engineering & Technical Software       da...@davegray.demon.co.uk

Re:Linked list vs TStringList


Quote
david Gray wrote:
> > 1)  Write my own linked list logic; 2) Use TStringList. I am not looking
> > for a great deal of functionality here.  Just a simple way to maintain
> > these records (add, delete, update, move, etc.).

Maybe you should take a look at TList. In short terms: It's TStringList without
strings. Or do you need strings? Then forget about it.

Werner.

Re:Linked list vs TStringList


Quote
In article <819459773...@davegray.demon.co.uk> david Gray <Da...@davegray.demon.co.uk> writes:
>From: david Gray <Da...@davegray.demon.co.uk>
>Subject: Re: Linked list vs TStringList
>Date: Wed, 20 Dec 95 11:42:53 GMT
>In article <4av453$...@newsbf02.news.aol.com>
>           perigee...@aol.com "PerigeeSY1" writes:
>> I am writing a program that will keep an undefined number of records in
>> memory at one time.  To do this, I have considered the following options:
>> 1)  Write my own linked list logic; 2) Use TStringList. I am not looking
>> for a great deal of functionality here.  Just a simple way to maintain
>> these records (add, delete, update, move, etc.).

>> Questions:  Which method would you recommend?  Have I missed other
>> options?  What are the pros and cons of each method?  I know that to use
>> the TStringList I would have to add objects to the list rather than simply
>> adding records.  Are there any other "overhead" items such as this that I
>> should know about before I proceed.
>How undefined?  Is there a sensible upper limit which would allow you to
>define an array of pointers?
>If you could use an array, you would not incurr the overhead of the
>links and their management.
>--
>regards
>Dave Gray                                 Nailsea Bristol UK 01275 857746
>Bespoke Engineering & Technical Software       da...@davegray.demon.co.uk

Why not use a tlist - this already is set up to be dynamic, and it keeps
it's data as pointers, which can be type cast to anything you please

HTH

Boris Ingram, Cyborg Software
boris...@iafrica.com
http://www.pcb.co.za/users/borising/cyborg.htm

Re:Linked list vs TStringList


Thanks for the TList suggestions.  I will look into this - I'm sure I'll
have more questions to follow.

Bruce Bukovics

Other Threads