forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Simple File Compare Program...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Jan 22, 2002 7:28 pm    Post subject: Simple File Compare Program... Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group