Solved

Compare StringLists

Posted on 1998-05-28
2
945 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now