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 


MATCH [SOLVED]

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Thu Sep 15, 2011 5:54 pm    Post subject: MATCH [SOLVED] Reply with quote

ok i need to find all the items that dont match in 2 files and add those to a seperate list save to file and open. am i doing this correct?


old code
Code:

TITLE SORT
  DIALOG CREATE,SORT,-1,0,0,0
  DIALOG SHOW
  DIALOG HIDE
  %%LIST1 = @FILEDLG(LIST 1, LIST 1)
  %%LIST2 = @FILEDLG(LIST 2, LIST 2)
   
  LIST CREATE, 1, SORTED
  LIST CREATE, 2, SORTED
  LIST CREATE, 3
  LIST LOADFILE, 1, %%LIST1
  %%L1COUNT = @COUNT(1)
 
  LIST LOADFILE, 2, %%LIST2
  %%L2COUNT = @COUNT(2)
  LIST SEEK, 1, 0
  %A = 0
  IF @GREATER(%%L1COUNT,%%L2COUNT)
  %%COUNT = %%L1COUNT
  GOTO LIST1
  ELSE
  %%COUNT = %%L2COUNT
  GOTO LIST2
  END
 
  :LIST2
  REPEAT
  INFO @ITEM(1)@CR()@ITEM(2)
  LIST SEEK, 2, %A
  %M = @MATCH(1,@ITEM(2))
  IF %M
  INFO MATCH
  ELSE
  INFO @ITEM(1)
  LIST ADD, 3, @ITEM(1)
  END
  %A = @FADD(%A,1)
  UNTIL @EQUAL(%A, %%COUNT)
  GOTO CLOSE
 
  :LIST1
  REPEAT
  INFO @ITEM(1)@CR()@ITEM(2)
  LIST SEEK, 1, %A
  %M = @MATCH(2,@ITEM(1))
  IF %M
  INFO MATCH
  ELSE
  LIST ADD, 3, @ITEM(2)
  END
  %A = @FADD(%A,1)
  UNTIL @EQUAL(%A, %%COUNT)
  GOTO CLOSE
 
    :close
    LIST CLOSE, 1
    LIST CLOSE, 2
    LIST SAVEFILE, 3, @CURDIR()\NO_MATCH.TXT
    SHELL OPEN, @CURDIR()\NO_MATCH.TXT
    LIST CLOSE, 3
  exit






new code
Code:




  TITLE SORT
  DIALOG CREATE,SORT,-1,0,0,0
  DIALOG SHOW
  DIALOG HIDE
  %%LIST1 = @FILEDLG(LIST 1, LIST 1)
  %%LIST2 = @FILEDLG(LIST 2, LIST 2)
   
  LIST CREATE, 1, SORTED
  LIST CREATE, 2, SORTED
  LIST CREATE, 3
  LIST LOADFILE, 1, %%LIST1
  %%L1COUNT = @COUNT(1)
 
  LIST LOADFILE, 2, %%LIST2
  %%L2COUNT = @COUNT(2)
  LIST SEEK, 1, 0
  %A = 0
  IF @GREATER(%%L1COUNT,%%L2COUNT)
  %%COUNT = %%L1COUNT
  GOTO LIST1
  ELSE
  %%COUNT = %%L2COUNT
  GOTO LIST2
  END
 
  :LIST2
  REPEAT
  LIST SEEK, 2, %A
  %M = @MATCH(1,@ITEM(2))
  IF %M
  ELSE
  LIST ADD, 3, @ITEM(2)
  END
  %A = @FADD(%A,1)
  UNTIL @EQUAL(%A, %%COUNT)
  GOTO CLOSE
 
  :LIST1
  REPEAT
  LIST SEEK, 1, %A
  %M = @MATCH(2,@ITEM(1))
  IF %M
  ELSE
  LIST ADD, 3, @ITEM(1)
  END
  %A = @FADD(%A,1)
  UNTIL @EQUAL(%A, %%COUNT)
  GOTO CLOSE
 
    :close
    LIST CLOSE, 1
    LIST CLOSE, 2
    LIST SAVEFILE, 3, @CURDIR()\NO_MATCH.TXT
    SHELL OPEN, @CURDIR()\NO_MATCH.TXT
    LIST CLOSE, 3
  exit
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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