Mcgillivray, Donald [ITS]
donald.a.Mcgillivray at mail.sprint.com
Wed Mar 10 10:57:07 CST 2004
Yes. Thanks for the clarification! -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: Tuesday, March 09, 2004 7:09 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Framework Discussion - Questions and answers Don, Initialize and Terminate are the only two built in event sinks of the class. This means that these events fire and the code in these subs run regardless of anything else. Initialize runs before anything else in the class, and Terminate runs immediately as the last pointer to the class is set to nothing. Init() and Term() are METHODS of the class, not events. They can be called by code after the class is instantiated. Because Initialize() runs before anything else occurs there is no way for us to pass parameters in to it. Init() is just a method like any other and I can specify any parameters I want, and then pass in to the class things that it routinely needs to have to function. In fact I choose the name Init, it is a method I write and I could just as easily name it JCsSpecialInitialization() if I so desired. Obviously we need standard practices so if I need to pass in parameters to a class I always use the name Init() as the function for that purpose. If I need to cleanup, and that cleanup needs to be available from outside the class, I use Term() as the function name. Typically I use Initialize to initialize things like classes and collections. For example: dim mcolControls as collection The dim simply reserves a variable for the collection, it doesn't make it useable. To do that we need a set statement: set mcolControls = new Collection. I will almost always put that set statement in the Initialize event so that a) it is always initialized b) I can go one place to find all set statements for objects in the class' header On the other hand I almost always place all of my cleanup of these objects (set mcolControls = nothing) in my term and call term from Terminate. I do that because: a) I almost always call Terminate from outside the class but... b) if for some reason the last pointer to the class is just set to nothing "accidentally" term will still run because Terminate will fire. Did all that make sense? John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Mcgillivray, Donald [ITS] Sent: Tuesday, March 09, 2004 4:03 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Framework Discussion - Questions and answers If I may deviate from the course this thread has taken . . . ;o) John, Your classes contain Init and Term methods and in addition dclsFrm includes Class_Initialize and Class_Terminate methods. If you have covered this already, please bear with me as I struggle to get my head around the basics, but are the latter "special" methods automatically invoked whenever the class is instantiated and destroyed? If so, why not simply embed the Init and Term functionality in them and be done with it. Thanks again for the generous contribution of your time and effort to our further understanding of these concepts. This list is the greatest thanks to contributions from folks like you. Don McGillivray -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Philippe Pons Sent: Tuesday, March 09, 2004 12:18 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Framework Discussion - Questions and answers Tu lui chantes: "Voulez vous coucher avec moi, ce soir?" and the magic could occur! Philippe ----- Original Message ----- From: "Arthur Fuller" <artful at rogers.com> To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com> Sent: Tuesday, March 09, 2004 8:51 PM Subject: RE: [AccessD] Framework Discussion - Questions and answers > How do I get Penelope Cruz to sleep with me? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. > Colby > Sent: Tuesday, March 09, 2004 3:36 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Framework Discussion - Questions and answers > > > If anyone has any questions please feel free to post them. I will > answer to the best of my abilities. > > John W. Colby > www.ColbyConsulting.com > > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com