Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
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
Today is November 21, 2024, 7:08 am This article has been viewed 35308 times. Google search has resulted in 31 hits on this article since January 25, 2004.
|
|