Yes thats true. they could rewrite the VCL code to cater for that issue. Cant say I&#39;ve ever actually encountered this problem before. <div><br></div><div>normally if I am binding anything in a list box, then I am binding a real pointer to some other object that might contain an integer property.. I dont think I&#39;ve ever used it to store an integer that was not a real pointer.<br>
<br><div class="gmail_quote">On Tue, Feb 16, 2010 at 2:54 PM, Jeremy North <span dir="ltr">&lt;<a href="mailto:jeremy.north@gmail.com">jeremy.north@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
True, but as Joylon correctly points out, you can (in the VCL)<br>
actually cater for the difference in a &quot;real&quot; index out of bounds<br>
error and a LongInt(TObject) typecase returning -1.<br>
<br>
It&#39;s a bug and should be logged on QC, if it isn&#39;t there already.<br>
<div><div></div><div class="h5"><br>
On Tue, Feb 16, 2010 at 12:50 PM, Kyley Harris &lt;<a href="mailto:Kyley@harrissoftware.com">Kyley@harrissoftware.com</a>&gt; wrote:<br>
&gt; interesting<br>
&gt;&gt;    if Longint(Result) = LB_ERR then Error(SListIndexError, Index);<br>
&gt; it would seem that the error is not in delphi at all. Well.. they are simply<br>
&gt; raising the Windows error which say that -1 is the error result for a bad<br>
&gt; index access from windows. if delphi were to ignore this error and you asked<br>
&gt; for the value at index[99] which was out of bounds and you got -1 instead of<br>
&gt; an error I think there would be the same number of complaints from the other<br>
&gt; side.<br>
&gt; Clearly its the windows API that considers -1 invalid.. not delphi.<br>
&gt;<br>
&gt; On Tue, Feb 16, 2010 at 2:24 PM, Karl Reynolds<br>
&gt; &lt;<a href="mailto:kreynolds@chocfishsoft.co.nz">kreynolds@chocfishsoft.co.nz</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Feb 16, 2010 at 1:55 PM, Alister Christie<br>
&gt;&gt; &lt;<a href="mailto:alister@salespartner.co.nz">alister@salespartner.co.nz</a>&gt; wrote:<br>
&gt;&gt; &gt; I think the point I was trying to make is that it is that the method<br>
&gt;&gt; &gt; (/array indexer or whatever) was expecting a TObject - passing anything<br>
&gt;&gt; &gt; else could result in unexpected results.<br>
&gt;&gt;<br>
&gt;&gt; Only if you stipulate that you have to remain ignorant of the function<br>
&gt;&gt; internals. The TObject is converted back and forth from a LongInt in<br>
&gt;&gt; order to store it anyway (see GetObject and PutObject).<br>
&gt;&gt;<br>
&gt;&gt; &gt; The fact that -1 doesn&#39;t work<br>
&gt;&gt; &gt; is therefor not a bug (unless you can have 1 byte sized objects).<br>
&gt;&gt;<br>
&gt;&gt; var x: longint;<br>
&gt;&gt;<br>
&gt;&gt; x := -1; // Four bytes<br>
&gt;&gt;<br>
&gt;&gt; (May the source be with you).<br>
&gt;&gt;<br>
&gt;&gt; Cheer,<br>
&gt;&gt; Karl<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; NZ Borland Developers Group - Delphi mailing list<br>
&gt;&gt; Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
&gt;&gt; Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
&gt;&gt; Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject:<br>
&gt;&gt; unsubscribe<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Kyley Harris<br>
&gt; Harris Software<br>
&gt; +64-21-671-821<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; NZ Borland Developers Group - Delphi mailing list<br>
&gt; Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
&gt; Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
&gt; Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject:<br>
&gt; unsubscribe<br>
&gt;<br>
<br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Kyley Harris<br>Harris Software<br>+64-21-671-821<br>
</div>