Click here to Skip to main content
15,920,633 members
Home / Discussions / C#
   

C#

 
Questionhow to create a color eyedroppper? Pin
relsirc2-Aug-06 4:36
relsirc2-Aug-06 4:36 
AnswerRe: how to create a color eyedroppper? Pin
Ennis Ray Lynch, Jr.2-Aug-06 4:42
Ennis Ray Lynch, Jr.2-Aug-06 4:42 
Questionhow to remove duplicate characters from a text file [modified] Pin
vp152-Aug-06 4:35
vp152-Aug-06 4:35 
AnswerRe: how to remove duplicate characters from a text file Pin
Ennis Ray Lynch, Jr.2-Aug-06 4:44
Ennis Ray Lynch, Jr.2-Aug-06 4:44 
QuestionClass doesn't support Automation [modified] Pin
Lupson2-Aug-06 4:21
Lupson2-Aug-06 4:21 
QuestionHow to set zoom in WebBrowser? Pin
Dima Filipiuk2-Aug-06 3:46
Dima Filipiuk2-Aug-06 3:46 
QuestionCompare values with List Pin
abnorm2-Aug-06 3:30
abnorm2-Aug-06 3:30 
AnswerRe: Compare values with List [modified] Pin
Wjousts2-Aug-06 3:48
Wjousts2-Aug-06 3:48 
abnorm wrote:
I hope I make my self clear


I wouldn't get your hopes up. Poke tongue | ;-P

What exactly are you trying to accomplish here? Are you trying to merge two lists into one new list? Are the lists that you are merging sorted or not? Does the new list need to be sorted?

If your original two lists are sorted it should be fairly easy to merge them together by starting at the begining of both lists and comparing the items from each list, then take the lowest (or highest, depending on which way you are sorting) and add it to your new list. Move to the next item in the list you took the item from and continue until you reach the end of both lists.


-- modified at 9:51 Wednesday 2nd August, 2006

Looking at your post again it looks like you are trying to take two list of different objects and match them based on one field (the 11,22,33 field) to create a new object that basically links them together. Is this correct?
If so, it should still be easy and is conceptually similar to merging lists. Sort both list first and compare the top two items. If they match then create your new object and add it to your final list. If not then move the lower of the two to the next item in the list and repeat until you reach the end of one of the lists.

Example, say you have these two lists
List A    List B
11        11
22        22
33        44
44        55
55


You would do this: compare 11 from A with 11 from B. They match so you create your new object and put it into you final list. Then you move both lists onto the second item and compare 22 with 22. They match again so you create a new item and put it in the final list. Move both lists on and compare 33 with 44. These don't match so you don't create a new item, instead you move the list with the lower value on by one and compare 44 with 44. You have you match and you create a new item. Finally you compare 55 with 55, create a new item and you are done. Simple.
AnswerRe: Compare values with List Pin
Ingo2-Aug-06 3:48
Ingo2-Aug-06 3:48 
GeneralRe: Compare values with List Pin
Wjousts2-Aug-06 4:01
Wjousts2-Aug-06 4:01 
GeneralRe: Compare values with List Pin
abnorm2-Aug-06 4:13
abnorm2-Aug-06 4:13 
GeneralRe: Compare values with List Pin
Wjousts3-Aug-06 3:23
Wjousts3-Aug-06 3:23 
GeneralRe: Compare values with List Pin
Ingo2-Aug-06 4:19
Ingo2-Aug-06 4:19 
GeneralRe: Compare values with List Pin
abnorm2-Aug-06 4:32
abnorm2-Aug-06 4:32 
GeneralRe: Compare values with List Pin
Ingo2-Aug-06 5:47
Ingo2-Aug-06 5:47 
Questionhow to draw ractangle in picturebox at runtime manually Pin
kalaveer2-Aug-06 3:18
kalaveer2-Aug-06 3:18 
AnswerRe: how to draw ractangle in picturebox at runtime manually Pin
Wjousts2-Aug-06 3:24
Wjousts2-Aug-06 3:24 
AnswerRe: how to draw ractangle in picturebox at runtime manually Pin
stancrm2-Aug-06 3:29
stancrm2-Aug-06 3:29 
QuestionGetting C# to pull Outlook e-mail when computer is locked Pin
matt23lucier2-Aug-06 3:04
matt23lucier2-Aug-06 3:04 
AnswerRe: Getting C# to pull Outlook e-mail when computer is locked Pin
Corinna John2-Aug-06 3:52
Corinna John2-Aug-06 3:52 
GeneralRe: Getting C# to pull Outlook e-mail when computer is locked Pin
matt23lucier2-Aug-06 7:32
matt23lucier2-Aug-06 7:32 
QuestionDelete Registry settings in uninstall Pin
Saamir2-Aug-06 2:47
Saamir2-Aug-06 2:47 
AnswerRe: Delete Registry settings in uninstall Pin
Dustin Metzgar2-Aug-06 4:17
Dustin Metzgar2-Aug-06 4:17 
QuestionRe: Delete Registry settings in uninstall Pin
Saamir2-Aug-06 4:37
Saamir2-Aug-06 4:37 
AnswerRe: Delete Registry settings in uninstall Pin
Saamir2-Aug-06 5:04
Saamir2-Aug-06 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.