Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Jan 22, 2002 7:28 pm Post subject: Simple File Compare Program... |
|
|
OK, it's nothing spectacular, but maybe someone
wants to add some features...
__________________________________________________________________________________________________________________________
| Code: |
rem -- VDS3 and VDS4 compatible --
rem -- Simple file compare program --
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,Test prog,-1,0,300,220
DIALOG ADD,BUTTON,LoadFile1,5,5,60,20
DIALOG ADD,BUTTON,LoadFile2,5,70,60,20
DIALOG ADD,BUTTON,Compare,5,135,60,20
DIALOG ADD,LIST,L1,30,5,290,165
rem -- Put horizontal scroll on list --
%z = @sendmsg(@winexists(~L1),$0194,2000,0)
DIALOG ADD,STATUS,Stat
DIALOG SHOW
LIST CREATE, 1
LIST CREATE, 2
:EVLOOP
DIALOG SET, Stat, "Ready..."
WAIT EVENT
goto @event()
:LoadFile1BUTTON
%%f1 = @filedlg()
if %%f1
LIST LOADFILE, 1, %%f1
end
goto EVLOOP
:LoadFile2BUTTON
%%f2 = @filedlg()
if %%f2
LIST LOADFILE, 2, %%f2
end
goto EVLOOP
:CompareBUTTON
if @not(@both(%%f1, %%f2))
INFO You must select 2 files ... @tab()
goto EVLOOP
end
LIST CLEAR, L1
LIST ADD, L1, Comparing %%f1 and %%f2
LIST ADD, L1, ""
DIALOG SET, Stat, "Comparing files..."
%x = 0
REPEAT
if @item(1,%x)
%y = 0
REPEAT
if @equal(@item(1, %x), @item(2, %y))
LIST ADD, L1, [File 1 line @succ(%x) File 2 line @succ(%y)] @item(1, %x)
end
%y = @succ(%y)
UNTIL @equal(%y, @count(2))@greater(%y, @count(2))
end
%x = @succ(%x)
UNTIL @equal(%x, @count(1))@greater(%x, @count(1))
if @greater(3, @count(L1))
LIST ADD, L1, "No match found..."
end
goto EVLOOP
:CLOSE
EXIT
|
_________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|