On Mar 15, 2006, at 4:02 PM, Joseph J. Strout wrote:
At 3:25 PM -0500 3/15/06, Charles Yeomans wrote:
When you call an object method using a nil object reference,
REALbasic raises a NilObjectException. If, however,
nilObjectChecking is set to false in a pragma statement, what should
happen? What does happen is that the method is called and executes,
and RS says that this is the correct behavior. Upon reflection it
appears that this isn't so unreasonable; I suppose at some level this
is equivalent to calling the method with (secret) first parameter
nil. So is the real danger here that a method called on a nil
reference might attempt to access object properties?
Yes. Such an attempt would most likely crash the app.
Indeed it does.
It turns out that you can still implement nil object checking -- for
example,
Sub Foo()
If me is nil then
//do something odd
Else
End if
End Sub
So I need to think of something odd to do with this behavior.
--------------
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>