Results 1 to 6 of 6

Thread: High Class Question

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3
    I'm making a program that does various things in a complicated way and there's a a bug

    I'm using a lot of modules which get used, then left alone for a long time, some of these modules use class modules, but a lot of the time instances of these classes are left open after the module is finished with.

    I don't want to change the whole structure of my program to close them but I do want them closed.

    Can I get a collection or something of all instances of a certain class so I can just loop through and close them.

  2. #2
    Junior Member
    Join Date
    Nov 1999
    Location
    Forsyth, GA, USA
    Posts
    26
    If you implement a common inferface with all of the classes, shouldn't you be able to do just that?
    Brad
    Contract Developer

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3
    I don't understand. I need to be able to close all instances of a class, how will making the the interfaces of different classes the same help?

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You would have to close them manually

    If you have several objects declared in different modules, i think you could make all modules containg two methods, one that inits all objects and one that unloads them..
    For instance:

    Code:
    Module1.InitObjs
    Module2.InitObjs
    'Do stuff
    Module1.TerminateObjs
    Module2.TerminateObjs
    Then you have in the modules
    Code:
    Public object1 as class1,object2 as class1
    
    sub InitObjs
     Set object1=new class1
     set object2=new class2
    end sub
    sub TerminateObjs
     Set object1=nothing
     set object2=nothing
    end sub
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3
    That's exactly what I wanted to avoid

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Well, you can't, but there's another way

    you can load all objects under one main object, and then you unload the main object, which will terminate all subobjects
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width