> you should care greatly, because this is violating OOP principles 

I care about code that works and gets a job of work done.  "OO Principles" are 
for the classroom.


> Obviously the GetObject source cares somewhat about what -1 points to.

No, it doesn't.  It simply gets confused because the Windows API uses "-1" to 
indicate that an error occurred in retrieving an item's data and the VCL is 
then naively assuming that ANY error in retrieving an item's data must be a 
List Index error.

Even though it could (and should) specifically test for index validity before 
calling the API and so discount that possible source of an error from the 
outset.

Indeed, the TObject(-1) result is cast BACK to a LongInt(-1) for testing 
against the simple value LB_ERR (which == -1) ... the source of this error has 
nothing what-so-ever to do with the casting of the value as TObject.



_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to