Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing projects

Status
Not open for further replies.

mpgalvin

Programmer
Feb 5, 2001
119
IE
Anyone out there know of a good (free) utility I can use to compare 2 projects. They were both the same yesterday, but I had to make some changes onsite. Then I lost my copy of the changes, and started doing them again back at my desk. Now I've got the copy back again (yeah, I know, I suck)

I'd need something that will scan the memo fields in all .scx files, I guess?
 
Well, if you have the copy (I assume you mean the changes you made onsite) back again ... why not just put that into your development area and forget about it ?

Or did you make additional modifications beyond those onsite changes ?


Don
dond@csrinc.com

 
Don, yep, that's the problem. Assuming I lost it, I made what changes I could remember from onsite then continued developing it. Now that I have the onsite copy, I'd like to make sure that I have everything (I'm not unduly worried - the bugs I fixed were great big honking ones that I'd never seen before, so they'll come up again real soon)
 
If you talking about comparing all the files in a project, then I believe you can use SCCTEXT.PRG, and a text file compare program like WIDIFF.EXE.

Just write a program to go through the files in the project - you could open the .PJX file as a table and use it to locate the files, or you could use the Project Object to provide the same file list. Next use SCCTEXT to produce two files one for the one version and the second for the other version (SCCTEXT.PRG is what Visual SourceSafe uses to compare VFP file changes). Note: SCCTEXT can process all the table based components - Forms, Classes, Reports, Labels, Menus and DBCs. Then call WINDIFF.EXE with these two files, and it should show you the differences - while sometimes it's not 'exactly' like it is in the file, it'll certainly give you an idea of what's changed and where.

Note: You can get an updated version of SCCTEXT from my user group site ( in the files section - it does a better job of recognizing when form and class procedures have just been moved around (the original treats them as an Delete and Add).

Rick
 
Hi

Method1:
********
Find and list all files modified on or after a particular date. This can be modified to take care of time as well. But I have not done that here for simplicity.
***********************************************************
** PRG - ExpPjx.PRG - Explore Project
** Author.. Subramanian.G
** HowTo.. DO ExpPjx WITH ProjectName, dateSinceModified
** Browse window displays the files modified.
***********************************************************
PARAMETERS myProject,myDate
getTstamp = timeStamp(myDate) && If today is the modiied date
SELECT ALLTRIM(NAME) AS FilesModified From myProject+".pjx" INTO DBF mFiles WHERE timestamp > getTstamp
BROWSE && list of modified files
USE
***********************************************************
FUNCTION timeStamp
PARAMETERS dDate && Probable Date of current project revision - may be today
nTimeStamp = (((((YEAR(dDate)-1980)*16)+MONTH(dDate))*32)+DAY(dDate))*32*64*32
RETURN INT(nTimeStamp)
***********************************************************
** EOF
***********************************************************

Method2:
******** Compare two project files...
SELECT a.* FROM Path1Project.pjx a, Path2Project.pjx b ;
INTO DBF fileNew WHERE ;
a.timestamp > b.timestamp
BROWSE

This will give Path1 project having newer files than Path2 project. Beware of correction made in path2 afterwards and then compared.

Hope he idea helps :)
ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
ramani, great plan, but onsite, I built the exe, and rebuilt all files, so they all have the same date.

Rick, your idea looks like a winner, but I've never used SCCTEXT before - I downloaded it, but how do I run it (I assume it required parameters or something?)
 
OK, while I hate to give away all my &quot;secrets&quot; <g>, this is part of a larger program (it verifies that the files passed in, are of the appropriate type).
Code:
* Program....: COMPARESCC.PRG
* Version....: 1.0
* Author.....: ** Richard G Bean **
* Date.......: January 1, 2001
* Notice.....: Copyleft 2001 ** Melange Computer Services, Inc **
* Compiler...: Visual FoxPro 06.00.8862.00 for Windows
*
* Abstract...: Compares Table based files with SCCTEXT.PRG (Includes sorted methods patch)
*              Should work with .SCX, .VCX, .MNX, .FRX and .LBX files
*
* Parameters.: FileName1, FileName2 - files need to be in current directory or be fully qualified
*
* Changes....:

LPARAMETERS zcFileName, zcFileName2
LOCAL lcLocalFile, lcNetFile, lcExtension

zcFileName = ALLTRIM(zcFileName)
* assume fully qualified
lcLocalFile = zcFileName
lcNetFile = zcFileName2

IF !FILE(lcLocalFile)
   MESSAGEBOX(&quot;Missing File: '&quot;+lcLocalFile+&quot;'&quot;,;
     0 , &quot;Please Note&quot;)
   RETURN
ENDIF
IF !FILE(lcNetFile)
   MESSAGEBOX(&quot;Missing File: '&quot;+lcNetFile+&quot;'&quot;,;
     0 , &quot;Please Note&quot;)
   RETURN
ENDIF

do scctext.prg with &quot;&lcLocalFile&quot;
do scctext.prg with &quot;&lcNetFile&quot;

lcLocalFile = LEFT(lcLocalFile, (LEN(lcLocalFile)-1))+&quot;A&quot;
lcNetFile = LEFT(lcNetFile, (LEN(lcNetFile)-1))+&quot;A&quot;

do windiffw with &quot;&lcLocalFile&quot;, &quot;&lcNetFile&quot;

DELETE FILE &quot;&lcLocalFile&quot;
DELETE FILE &quot;&lcNetFile&quot;

*-------------------------------------------------------
* Procedure...: windiffw
* Called by...:
*
* Abstract....: Show File differences using WINDIFF.EXE
*
* Parameters..: Two files to compare
*
* Notes.......:
*-------------------------------------------------------
PROCEDURE windiffw(p_cFile1, p_cFile2)
IF WINDIFF(p_cFile1, p_cFile2)
   ** Wait till it gets started **
   DO WHILE !CheckForInstance(&quot;WinDiff&quot;)
      DOEVENTS()
   ENDDO
   ** Wait till I'm done looking **
   DO WHILE CheckForInstance(&quot;WinDiff&quot;)
      DOEVENTS()
   ENDDO
ENDIF
	
RETURN
ENDPROC &&* windiffw

*-------------------------------------------------------
* Function....: CheckForInstance
* Called by...:
*
* Abstract....: Checks if a given window with title exists
*
* Returns.....: T/F depending if window exists
*
* Parameters..: Window title to look for
*
* Notes.......:
*-------------------------------------------------------
FUNCTION CheckForInstance(tcWindowTitle)

IF PCOUNT() = 0
   tcWindowTitle = &quot;Microsoft Visual FoxPro&quot;
ENDIF

DECLARE INTEGER FindWindow IN Win32api STRING,STRING

nWinHandle = FindWindow(NULL, tcWindowTitle)
IF nWinHandle <> 0
   RETURN .T.
ENDIF
RETURN .F.

ENDFUNC &&* CheckForInstance

*-------------------------------------------------------
* Function....: WINDIFF
*
* Abstract....: Fires up a copy of WINDIFF.EXE in a
*               known location
*
* Parameters..: Two files to compare
*
* Notes.......:
*-------------------------------------------------------

LPARAMETERS p_cFile1, p_cFile2
#INCLUDE WinDiffLocs.h && supplies path values for:
*  cLocalWinDiff
*  cNetWinDiff

LOCAL lcAppDir

lcAppDir = ADDBS(JUSTPATH(SYS(16,1)))
DO CASE
CASE FILE(lcAppDir+&quot;WINDIFF.EXE&quot;)
   lcFileLoc = lcAppDir+&quot;WINDIFF.EXE&quot;
   run /n &quot;&lcFileLoc&quot; &quot;&p_cFile1&quot; &quot;&p_cFile2&quot;
CASE FILE(cLocalWinDiff+&quot;WINDIFF.EXE&quot;)
   lcFileLoc = cLocalWinDiff+&quot;WINDIFF.EXE&quot;
   run /n &quot;&lcFileLoc&quot; &quot;&p_cFile1&quot; &quot;&p_cFile2&quot;
CASE FILE(cNetWinDiff+&quot;WINDIFF.EXE&quot;)
   lcFileLoc = cNetWinDiff+&quot;WINDIFF.EXE&quot;
   run /n &quot;&lcFileLoc&quot; &quot;&p_cFile1&quot; &quot;&p_cFile2&quot;
OTHERWISE
   MESSAGEBOX(&quot;Can't Find 'Windiff.EXE'&quot;, 0+16,;
     &quot;Please Note&quot;)
   RETURN .F.
ENDCASE

RETURN .T.
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top