[Tutor] using global objects in classes

Furmanek, Greg Greg.Furmanek@hit.cendant.com
Wed, 28 Jun 2000 13:25:13 -0400


Here is a situation for you guys. I hope you can help me.

I got 3 files.  I want to create a global object which can be 
used in all three files.  The definition of the class is in 
file 2.  The object itself is created in main file (1).

When I want to use the object in file 3 I get a NameErro.
The only way I was able to use the global object is if
I pass it to the new class.

Is there any other way to define the object to be
able to use it in any class without explicitly passing
it into the class as an argument??
        
      +----------------+    +----------------+
      |                |    |                |
      |  file 1 - main |    | file 2         |
      |  global object |    | class object   |
      |  created       |    |                |
      |                |    |                |
      |                |    |                |
      |                |    |                |
      |                |    |                |
      +----------------+    +----------------+

      +----------------+
      |                |
      | file 3         |
      | using global   |
      | object         |
      |                |
      |                |
      |                |
      |                |
      +----------------+