|
-
Oct 13th, 2000, 01:10 PM
#1
i have three listboxes:
one is filled with numbers(LONG).
the second is filled with numbers(LONG).
the numbers in the second could be duplicates
of what is in the first listbox, and even those
numbers may be listed more than twice.
how can i do a search using the number from the
first listbox and pulling the same number(s) from
the second listbox and add those that are found to
the third listbox.
this thing has me confused, plus fighting the flu while
trying to think...
thankx for all help,
larryn
-
Oct 13th, 2000, 01:26 PM
#2
transcendental analytic
Try this out:
Code:
For x = 0 To List1.ListCount - 1
For y = 0 To List2.ListCount - 1
If List1.List(x) = List2.List(x) Then Exit For
Next y
If y < List2.ListCount Then List3.AddItem List1.List(x)
Next x
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 13th, 2000, 01:42 PM
#3
that was pretty fast coding,
but the part:
Code:
If List1.List(x) = List2.List(x) Then Exit For
List2.List(x) does not loop through the list,
it stays on the first number for the times there
are numbers in the second listbox.
is there a way to get it to loop?
-
Oct 13th, 2000, 01:42 PM
#4
Frenzied Member
Uhh, kedaman, I dont think that will work. Normally in a For/Next loop you do something with the variable you are using for the loop counter, but your code in the "For y..." loop keeps checking the same thing. I think you might need to change it to this:
Code:
For x = 0 To List1.ListCount - 1
For y = 0 To List2.ListCount - 1
If List1.List(x) = List2.List(y) Then Exit For
Next y
If y < List2.ListCount Then List3.AddItem List1.List(x)
Next x
-
Oct 13th, 2000, 01:59 PM
#5
transcendental analytic
Sorry guys! hope that got clear now
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 13th, 2000, 02:19 PM
#6
you guys are great, thankx!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|