` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

ABC: Passing Relation Manager to a class
1999-07-21 -- Phillip Carroll
 
Newsgroups: topspeed.topic.oop > I have a file called PRODUCTS.DAT, my app is PSYSTEM.APP. So when i compile, > this is generated in PSYSTEM.CLW: > > Access:PRODUCTS &FileManager > Access:PRODUCTS &RelationManager > > I am creating a class that will do some I/O on PRODUCTS so i want to still > make use of the instance of Access:PRODUCTS created without having to > create a different on in the .INI,.CLW of my class so that i can use > something like Access:PRODUCTS.Insert(). > > Of course, i get compiler error when the compile hits the .clw containing > class since it doesn't know what Access:PRODUCTS means. The bottemline is > that i am trying to have just one declaration of Access:PRODUCTS. Am i > missing something? Pass an object reference to your class. However, I suggest passing a Relation Manager object reference instead, so that you will have the ability to use Relation Manager methods as well as File Manager methods. The basic steps are outlined below. Add a property to your class properties: MyFile &RelationManager Have your Init method include another parameter: MyClass.Init PROCEDURE(RelationManager MyFile, ) CODE Self.MyFile &= MyFile After instantiating an object in your class, Initialize it with xxx.Init(Relate:Products, other parameters) Your other methods will be able to call nonprivate nonprotected methods using: Self.Myfile.Method(parameters) ! Relation Manager methods ! The Relation Manager Me property is the File Manager Self.MyFile.Me.Method(parameters) ! File Manager methods HTH Phil Carroll


Today is December 3, 2024, 11:55 am
This article has been viewed 35424 times.
Google search has resulted in 5 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: