Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compare two Classes
Message
 
To
25/04/2000 10:08:18
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00363127
Message ID:
00363273
Views:
18
John,

First for comparing ASCII files, I use Windiff (comes with VC++ and VStudio, search for windiff) this one, looks where the code is relative in the file and it shows when code is moved or added/removed.

To create a .PRG from a .VCX or .SCX I use the following prg I wrote some time ago: (It uses the class browser to do the hard work)
LPARAMETERS tcStartDir, tlNoSubDirs,tlNoForms,tlNoClasslibs

* gen_classtemplates.prg
*
* Generates templates of classlibs and/or forms for a given directory
* The scope is with or without subdirs
*
* tcStartDir: Full Path of the directory, doesn't have to end with an backslash
* tlNoSubDirs: When set to .T. it will not include files from subdirectories
* tlNoForms: When set to .T. no templates are generated for forms
* tlNoClasslibs: When set to .T. no templates are generated for classlibs.
*
* When the name of an classlib is classlib.vcx the generates template is classlib_vcx_template.vcx
*
* It respects the settings of SET SAFETY and will act accordingly
*
* Usage:
* DO gen_classtemplates WITH "C:\VFP6LIB" && This will generate templates for forms and classlibs in C:\VFP6LIB and all subdirs
* 

IF VARTYPE(tcStartDir)<>"C"
	RETURN .F.
ENDIF

IF VARTYPE(_BROWSER)<>"O"
	DO (_BROWSER) WITH ,,,,,,.T.
ELSE
	_BROWSER.HIDE()
ENDIF

LOCAL lnDir,lnNumDir,lnNumADir,laADIR,laDir,lnFor,lcExportFile

lnDir = 1
lnNumDir = 1
DIMENSION laDir(1)
laDir(1) = tcStartDir

DO WHILE lnDir <= lnNumDir
	DIMENSION laADIR(1,5)
	lnNumADIR = ADIR(laADIR,ADDBS(laDir(lnDir))+"*.*",'D')
	IF lnNumADIR > 0
		FOR lnFor = 1 TO lnNumADIR
			IF LEFT(laADIR(lnFor,1),1) <> '.'
				IF "D"$laADIR(lnFor,5) AND NOT tlNoSubDirs 
					lnNumDir = lnNumDir+1
					DIMENSION laDir(lnNumDir)
					laDir(lnNumDir) = laDir(lnDir)+'\'+;
						ALLTRIM(laADIR(lnFor,1))
				ELSE
					IF (UPPER(ALLTRIM(RIGHT(laADIR(lnFor,1),4)))$".VCX" AND !tlNoClasslibs) OR ;
						(UPPER(ALLTRIM(RIGHT(laADIR(lnFor,1),4)))$".SCX" AND !tlNoForms)
						lcExportFile=laDir(lnDir)+'\'+STRTRAN(ALLTRIM(laADIR(lnFor,1)),".","_")
						lcExportFile=lcExportFile+"_TEMPLATE.PRG"
						IF SET('SAFETY')<>'ON' OR !FILE(lcExportFile) OR ;
							MESSAGEBOX('File '+lcExportFile+' does exist, overwrite it?',292)=6
							_obrowser.openfile(;
								laDir(lnDir)+'\'+ALLTRIM(laADIR(lnFor,1)))
							wait window 'Creating '+lcExportFile NOWAIT
							_obrowser.exportclass(.F.,lcExportFile)
						ENDIF
					ENDIF
				ENDIF
			ENDIF
		ENDFOR
	ENDIF
	lnDir = lnDir+1
ENDDO
_obrowser.RELEASE()
wait window 'Creating complete' nowait
hth,
Frank Camp
Previous
Reply
Map
View

Click here to load this message in the networking platform