<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-02-04 waldo kitty <span dir="ltr"><<a href="mailto:wkitty42@windstream.net" target="_blank">wkitty42@windstream.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">On 2/4/2014 3:28 PM, Jim Leonard wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On 2/4/2014 1:40 PM, waldo kitty wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
i have a TSortedCollection that i'm allowing duplicate keys to be<br>
inserted in... the problem that i'm having is that the duplicate keys<br>
are in reverse order from how they were inserted...<br>
</blockquote>
<br>
Sounds like your TSortedCollection.Compare() needs additional logic. It isn't<br>
doing enough comparisons internally to order things properly.<br>
</blockquote>
<br></div>
possibly... i dunno... currently it compares the (pstring) keys only... i thought about trying to also include a second field (a double) which is used for the "time stamp" but i don't know how to do that without having to use the key and this "time stamp" field every time i do anything with the records...<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
i am overriding MyCollection^.Insert because i have additional tasks<br>
that need to be done at the time of insertion... without duplicate keys,<br>
</blockquote>
<br>
Wouldn't it be better to perform your additional tasks before the insertion,<br>
then call a normal .Insert? Why overload something if there isn't really a need<br>
to?<br>
</blockquote>
<br></div>
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 needs to be replaced (because the new record is newer) using AtPut and the non-added records must be logged and their reason for not being added (older or same)...</blockquote>
</div><br></div><div class="gmail_extra">Just a quick idea which could be completely wrong, but wouldn't it solve your issue if Compare always returned -1 instead of 0?<br clear="all"></div><div class="gmail_extra"><br>
-- <br>Frederic Da Vitoria<br>(davitof)<br><br>Membre de l'April - « promouvoir et défendre le logiciel libre » - <a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</div></div>