compare two strings or compare two files?

Reply

Join Date: Oct 2006
Posts: 3
Reputation: bobbymusic is an unknown quantity at this point 
Solved Threads: 0
bobbymusic bobbymusic is offline Offline
Newbie Poster

compare two strings or compare two files?

 
0
  #1
Oct 2nd, 2006
In my form I have two rich text boxes.In both of them I put two different text files(.txt or .rtf).I looking for some code to compare them, and to have the result as marked differences into the second rich text box.How I have to compare them-as strings or as files? And how I can use mid$ to compare them letter by letter to have the right positions of differences?
Thanks in advance!!!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: compare two strings or compare two files?

 
0
  #2
Oct 3rd, 2006
How, exactly, do you want to present the differences to the user? By, like, a string position (character 3 of file A and character 3 of B are different)? I can figure out how to pull this off if I know how you want to lay it out....
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 3
Reputation: bobbymusic is an unknown quantity at this point 
Solved Threads: 0
bobbymusic bobbymusic is offline Offline
Newbie Poster

Re: compare two strings or compare two files?

 
0
  #3
Oct 5th, 2006
Originally Posted by Comatose View Post
How, exactly, do you want to present the differences to the user? By, like, a string position (character 3 of file A and character 3 of B are different)? I can figure out how to pull this off if I know how you want to lay it out....
Actually ,the differences have to be shown in red color and if [Len(Text1.Text)<>Len(Text2.Text)] i.e. there's one or two words more in Text2,then these words have to be shown in red as differences etc.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC