Code Diff


How can I create a code-diff?
I will see the differences between two files:
-identic lines
-changed lines
-added lines
-deleted lines
I need an algorithm or a program code to do this

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I not sure exactly what your looking for.
You can use 'FC' from the command line to compare txt (code) files
usage FC file1 file2, use fc /? to get a full list of options
RamoniAuthor Commented:
i dont know how the fc command works, but can i take it for arrays of string or only strings (with Cr)? and whats the return value of the function?

exactly im looking for a compare meachanism to compare two arrays of strings -line for line.
I want to show the differences of the two arrays:
deleted, added and changed lines.
You use FC to compare two files
Just open the (dos) command prompt and type in FC FILENAME1 FILENAME2 and it returns the differences.

To compare two arrays of strings, you will have to write a function to do it. Are the arrays going to be fixed size single dimension or  multi dimension arrays or are they goin to be dynamic.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

RamoniAuthor Commented:
Thats my problem: how to write a function to compare the arrays.
I have two single dimension arrays, each array element for one line -> you can also create a "long" string with all elements of one array, and then compare the two strings.
I need a algorithm to compare..., within you can detect identic, deleted, added and changed lines.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from Ramoni from 12/11/2003 comment
Award points to Dang123 is recommend.
Please leave any comments here within the next seven days.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.