` Comparing two file structures (Mike Hanson) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Templates: Comparing two file structures
1998-10-23 -- Mike Hanson
 
Newsgroups: topspeed.products.c4 This should do the trick: #!----- #TEMPLATE(MyTpl,'My Templates'),FAMILY('ABC') #!----- #EXTENSION(EnsureDupFiles,'Ensure Dup Files'),APPLICATION,MULTI #PROMPT('File 1:',FILE),%File1,REQ #PROMPT('File 2:',FILE),%File2,REQ #VALIDATE(%File1<>%File2,'These cannot be the same!') #!----- #ATSTART #DECLARE(%MyKeyStruct),MULTI #DECLARE(%MyFieldStruct),MULTI #PURGE(%MyKeyStruct) #PURGE(%MyFieldStruct) #FIX(%File,%File1) #FOR(%Key) #ADD(%MyKeyStruct,%KeyStruct) #ENDFOR #FOR(%Field) #ADD(%MyFieldStruct,%FieldStruct) #ENDFOR #FIX(%File,%File2) #IF(ITEMS(%Key)<>ITEMS(%MyKeyStruct)) #INSERT(%NoMatch) #ENDIF #IF(ITEMS(%Field)<>ITEMS(%MyFieldStruct)) #INSERT(%NoMatch) #ENDIF #FOR(%Key) #SELECT(%MyKeyStruct,INSTANCE(%Key)) #IF(%KeyStruct<>%MyKeyStruct) #INSERT(%NoMatch) #ENDIF #ENDFOR #FOR(%Field) #SELECT(%MyFieldStruct,INSTANCE(%Field)) #IF(%FieldStruct<>%MyFieldStruct) #INSERT(%NoMatch) #ENDIF #ENDFOR #ENDAT #!----- #GROUP(%NoMatch) #ERROR(%File1 &' and '& %File2 &' do not match!') #!----- Catch you later! -=> Mike Hanson <=- www.BoxsoftDevelopment.com Chris Moore wrote: >Is it possible for a Template (global) to compare the structure (field >labels, types & sizes) between 2 files? I would like to have a Global >template that could do this everytime I compiled my DATA.DLL for my >system. (I must keep 2 files identical - except for the file name). > >Thanks > >Chris


Today is April 24, 2024, 11:04 pm
This article has been viewed 35109 times.
Google search has resulted in 31 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: