Solved

Compare StringLists

Posted on 1998-05-28
2
962 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 200 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
How to define IfThen functions in one common unit? 4 62
control image tags in a string ? 12 153
Wincontrol not (correctly) drawn 15 47
scroll down TListBox component in Delphi 1 31
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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