Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-07 Thread Frederic Da Vitoria
2014-02-07 waldo kitty wkitt...@windstream.net: On 2/6/2014 1:47 PM, Jim Leonard wrote: On 2/6/2014 11:04 AM, waldo kitty wrote: ahh... i see what you are doing... you are passing the pointer to the whole record instead of just the needed key... hummm... i'll have to think about that and

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-07 Thread waldo kitty
On 2/7/2014 4:06 AM, Frederic Da Vitoria wrote: 2014-02-07 waldo kitty wkitt...@windstream.net mailto:wkitt...@windstream.net: [...] so now i'm a bit confused but it has been a long day... again... :/ This makes sense... at least in your previous version: I guess catnbr is a string.

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-06 Thread Frederic Da Vitoria
2014-02-06 waldo kitty wkitt...@windstream.net: On 2/5/2014 3:57 AM, Frederic Da Vitoria wrote: [...] Once again I did not test this, but it seems to me that if Compare returned -1 instead of 0, any duplicate would be inserted after because it would never be considered as equal to any

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-06 Thread waldo kitty
On 2/5/2014 7:48 PM, Jim Leonard wrote: On 2/5/2014 5:24 PM, waldo kitty wrote: i'm unsure what to do or how to handle this so that there is a secondary (sub) sorting order so that the main key is the master sort and then a secondary key is used when duplicates are allowed... You put both key

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-06 Thread waldo kitty
On 2/6/2014 4:23 AM, Frederic Da Vitoria wrote: Then my trick does not work for you because it hides the fact that the records are identical. actually, the problem comes when referencing the IndexOf() the record... IndexOf(Item) is passed (unmodified) thru a couple of routines to finally end

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-06 Thread Jim Leonard
On 2/6/2014 11:04 AM, waldo kitty wrote: ahh... i see what you are doing... you are passing the pointer to the whole record instead of just the needed key... hummm... i'll have to think about that and how to do it in my app... right now i'm only passing the necessary key because the record is

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-06 Thread waldo kitty
On 2/6/2014 1:47 PM, Jim Leonard wrote: On 2/6/2014 11:04 AM, waldo kitty wrote: ahh... i see what you are doing... you are passing the pointer to the whole record instead of just the needed key... hummm... i'll have to think about that and how to do it in my app... right now i'm only passing

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-05 Thread Frederic Da Vitoria
2014-02-05 waldo kitty wkitt...@windstream.net: On 2/4/2014 5:16 PM, Frederic Da Vitoria wrote: 2014-02-04 waldo kitty wkitt...@windstream.net mailto: wkitt...@windstream.net: [...] i kinda thought about that earlier when i was digging thru the code... IIRC, insert was

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-05 Thread waldo kitty
On 2/5/2014 3:57 AM, Frederic Da Vitoria wrote: [...] Once again I did not test this, but it seems to me that if Compare returned -1 instead of 0, any duplicate would be inserted after because it would never be considered as equal to any other. But since you still want your collection to be able

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-05 Thread Jim Leonard
On 2/5/2014 5:24 PM, waldo kitty wrote: i'm unsure what to do or how to handle this so that there is a secondary (sub) sorting order so that the main key is the master sort and then a secondary key is used when duplicates are allowed... You put both key comparisons in the same .Compare

[fpc-pascal] TSortedCollection dupes ordering

2014-02-04 Thread waldo kitty
i have a TSortedCollection that i'm allowing duplicate keys to be inserted in... the problem that i'm having is that the duplicate keys are in reverse order from how they were inserted... i am overriding MyCollection^.Insert because i have additional tasks that need to be done at the time

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-04 Thread Jim Leonard
On 2/4/2014 1:40 PM, waldo kitty wrote: i have a TSortedCollection that i'm allowing duplicate keys to be inserted in... the problem that i'm having is that the duplicate keys are in reverse order from how they were inserted... Sounds like your TSortedCollection.Compare() needs additional

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-04 Thread waldo kitty
On 2/4/2014 3:28 PM, Jim Leonard wrote: On 2/4/2014 1:40 PM, waldo kitty wrote: i have a TSortedCollection that i'm allowing duplicate keys to be inserted in... the problem that i'm having is that the duplicate keys are in reverse order from how they were inserted... Sounds like your

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-04 Thread Frederic Da Vitoria
2014-02-04 waldo kitty wkitt...@windstream.net: On 2/4/2014 3:28 PM, Jim Leonard wrote: On 2/4/2014 1:40 PM, waldo kitty wrote: i have a TSortedCollection that i'm allowing duplicate keys to be inserted in... the problem that i'm having is that the duplicate keys are in reverse order from

Re: [fpc-pascal] TSortedCollection dupes ordering

2014-02-04 Thread waldo kitty
On 2/4/2014 5:16 PM, Frederic Da Vitoria wrote: 2014-02-04 waldo kitty wkitt...@windstream.net mailto:wkitt...@windstream.net: [...] i kinda thought about that earlier when i was digging thru the code... IIRC, insert was overridden because there are cases where the existing record