Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compare StringLists

Posted on 1998-05-28
2
Medium Priority
?
983 Views
Last Modified: 2012-05-04
I am looking for a clever solution to compare the content of a StringList 1 with the content
of a StringList b. The content of StringList a is a "snapshot" of a directory a few days ago
(i.e the name of the files in this directory) and the content of StringList b are the the actual
filenames found in the same directory. Maybe there are some more files today than bevor
or somes are deleted.

Any hint is welcome!

Thanks a lot.
0
Comment
Question by:rjufer
2 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 800 total points
ID: 1348479
I think the best solution is to sort both lists. Then you can walk thru the lists in the following manner: (I call them A and B)

If A[index] < B[Index] Then A has items, that are not present in B. Increase Index until A[Index] >= B[Index]

Likewise, if B[index] < A[Index] Then B has items, that are not present in A. Increase Index until B[Index] >= A[Index]

When Index exceeds the number of items in either list A or B, the remaining items in the other list are new entries.
0
 

Author Comment

by:rjufer
ID: 1348480
Hi

Thanks very mutch for your hint, just great .....!!!!

Rolf
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question