On Apr 24, 2006, at 9:07 AM, Charles Yeomans wrote:


On Apr 23, 2006, at 9:05 PM, Charles Ross wrote:

I'll change the order and see how it goes, but I put the window's constructor call before my initialization line and it worked fine, so perhaps the window's constructor doesn't call the control open events.

Sub Constructor()
  super.Window
  db = App.Database
End Sub


Super.Window calls the Open event handlers for the controls and the window. I've found that the better practice is to either add a constructor or implement Open events, but not both.

Charles Yeomans

If that's the case, then why does the above work? Originally, I was setting the db property in Window.Open, but there were controls that needed to access the property in their Open handlers, and they were executing before Window.Open. Creating the above Constructor solved the problem, i.e., I wasn't getting a NilObjectException after I added it, whereas I was before. This led me to conclude that the control Open handlers were executing before the Window.Open handler.

However, if super.Window executes the control open handlers, the Constructor above should raise the NilObjectExceptions again, but it doesn't.

Or am I missing something?

Thanks,
Chuck
_______________________________________________
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>

Reply via email to