interesting<div><br></div><div>> if Longint(Result) = LB_ERR then Error(SListIndexError, Index);</div><div><br></div><div>it would seem that the error is not in delphi at all. Well.. they are simply raising the Windows error which say that -1 is the error result for a bad index access from windows. if delphi were to ignore this error and you asked for the value at index[99] which was out of bounds and you got -1 instead of an error I think there would be the same number of complaints from the other side. </div>
<div><br></div><div>Clearly its the windows API that considers -1 invalid.. not delphi.<br><br><div class="gmail_quote">On Tue, Feb 16, 2010 at 2:24 PM, Karl Reynolds <span dir="ltr"><<a href="mailto:kreynolds@chocfishsoft.co.nz">kreynolds@chocfishsoft.co.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Tue, Feb 16, 2010 at 1:55 PM, Alister Christie<br>
<<a href="mailto:alister@salespartner.co.nz">alister@salespartner.co.nz</a>> wrote:<br>
> I think the point I was trying to make is that it is that the method<br>
> (/array indexer or whatever) was expecting a TObject - passing anything<br>
> else could result in unexpected results.<br>
<br>
</div>Only if you stipulate that you have to remain ignorant of the function<br>
internals. The TObject is converted back and forth from a LongInt in<br>
order to store it anyway (see GetObject and PutObject).<br>
<div class="im"><br>
> The fact that -1 doesn't work<br>
> is therefor not a bug (unless you can have 1 byte sized objects).<br>
<br>
</div>var x: longint;<br>
<br>
x := -1; // Four bytes<br>
<br>
(May the source be with you).<br>
<br>
Cheer,<br>
<font color="#888888">Karl<br>
</font><div><div></div><div class="h5">_______________________________________________<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>