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 


[resolved] Need Help with LISTS

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
xearo
Newbie


Joined: 01 Oct 2004
Posts: 18

PostPosted: Thu Oct 21, 2004 4:51 am    Post subject: [resolved] Need Help with LISTS Reply with quote

i have 2 lists which are filled with filenames

now the 2 lists are never filled with the same amount of items
but what i have to do is compare the 2 lists and find out if any items match and then remove them from the 2nd list

sorry if this has already been covered but i couldn't find any posts in the forum

my brain is on holiday today and i can't figure it out Embarassed

thankyou!
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Thu Oct 21, 2004 5:11 am    Post subject: Reply with quote

Code:

rem A couple of lists
  list create,1
  list loadtext,1
"Item 1
"Item 2
"Item A
"Item B
"Item 3
"Item 4

  list create,2
  list loadtext,2
"Item A
"Item B
"Item C
"Item D

rem A loop to compare list items
  %x = @count(1)
  %c  = 0
  repeat
    list seek,2,0
    %M = @match(2, @item(1,%c))
    if %M
      rem If we have a match in list 2 from list 1, delete the item in list 2
      list seek,2,@index(2)
      list delete,2
    end
    %c = @succ(%c)
  until @equal(%c,%x)

  rem Clean up
  list clear,2
  list clear,1
  list close,2
  list close,1



This might help. It's a very simple demo, so if you get more advanced
with this than it is, you need to add more error handling.

Happy coding... Cool

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
DavidR
Contributor
Contributor


Joined: 05 Aug 2003
Posts: 83
Location: Bethel Pennsylvania U.S.A.

PostPosted: Thu Oct 21, 2004 5:15 pm    Post subject: Re: Need Help with LISTS Reply with quote

Take a look in the "Visual DialogScript Open Source Projects" section of this Forum. I had posted a "Benchmark" program some time back which has similar functionality to what you may be looking for.

It uses lists to store all the file names on a disk drive and shows you what files have been added since you last ran it. (Used to detect the installation of unwanted/Unauthorized software).
..........David
Back to top
View user's profile Send private message
xearo
Newbie


Joined: 01 Oct 2004
Posts: 18

PostPosted: Fri Oct 22, 2004 12:22 am    Post subject: Reply with quote

Thanx for everyones help

finally got it working properly

greatly appreciated bweckel and DavidR

Thumbs Up
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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