I am using VB6 for programing.
I have made a very simple Address Program, but can anyone tell me if it is possible to find duplicated surnames
in a Sequential or a Random File?

Would be grateful for any help.

MDDS,

Not sure but I don't think it's possible to do this directly in the file, however, I have a tactic to do it in a clean and fairly simple way.

Create a UDT (User Defined Type) that contains the same elements as your text file
Create an array of this type
Read the file into the array
Sort the array
Eleiminate duplicates from the array
Write the array to a new file with the same name, unless you don't want to lose the original

If you don't want to have the file sorted after processing you'll need another array as an index that contains the original order of the records.

Hope this helps

Yomet

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.