Solved

Code Diff

Posted on 2003-12-10
7
355 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 192
message box in access 4 52
Problem to With line 4 74
Need Nag Screen for Reboot if system up time is over 14 days 12 81
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

762 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