Solved

Code Diff

Posted on 2003-12-10
7
351 Views
Last Modified: 2011-09-20
Hello

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


bye
Ramoni
0
Comment
Question by:Ramoni
7 Comments
 
LVL 2

Expert Comment

by:diarmaid
ID: 9912595
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
0
 

Author Comment

by:Ramoni
ID: 9918682
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.
0
 
LVL 2

Expert Comment

by:diarmaid
ID: 9919282
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.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Ramoni
ID: 9919556
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.
0
 
LVL 9

Accepted Solution

by:
Dang123 earned 40 total points
ID: 9920463
0
 
LVL 27

Expert Comment

by:planocz
ID: 10260559
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.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 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

13 Experts available now in Live!

Get 1:1 Help Now