Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove classes from memory
Message
From
17/10/2005 12:55:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Remove classes from memory
Miscellaneous
Thread ID:
01059635
Message ID:
01059635
Views:
52
Hi,

Please to look at this example:

In the newClasse2 procedure of Classe1 class,
If I instantiate the Classe2 I get the message "Remove classes from memory" when I try to edit the code.
If I instantiate the ClasseAbstrata I don't get the message "Remove classes from memory" when I try to edit the code.

I need to make a abstract class and specify them only with the specific features, but the objects be in the memory and causes problems when are many objects
Local lo as Classe1
Clear
lo = NewObject("Classe1")
lo.newClasse2()
lo.Testar()
***************** Classe1 ********************************
Define class Classe1 as ClasseAbstrata
  Procedure newClasse2 as Boolean
    Local loClasse2 as Classe2, loEmpty as Empty
    loClasse2 = NewObject("Classe2")         && Where try to edit this code I       get the message "Remove classes from memory"
*    loClasse2 = NewObject("ClasseAbstrata") && Where try to edit this code I don't get the message "Remove classes from memory"
    loClasse2.Testar()
    this.oRef.Add(loClasse2, "1")
  EndProc
EndDefine
***************** Classe2 ********************************
Define class Classe2 as ClasseAbstrata
EndDefine
***************** ClasseAbstrata *************************
Define class ClasseAbstrata as Custom
  oRef = null
  Procedure Init
    this.oRef = CreateObject("Collection")
    ? this.Class + " - No Init"
  EndProc
  Procedure Destroy
    ? this.Class + " - No Destroy"
  EndProc
  Procedure Testar
    ? this.Name + " funcionando - " + Time()
  EndProc
EndDefine
Next
Reply
Map
View

Click here to load this message in the networking platform