Search code examples
androidwindev

Call the previous class WinDev 21


Anyone know if it's possible make a call from one class to the class that has created it?

Class1 has an instance of Class2, I want to call a method of Class1 from Class2.

Among them there is none inheritance relationship.


Solution

  • Finally I found the way myself.

    I made in Class1 this methods:

    PROCEDURE Create()
    
     oClass.NewClass(object)
    
    PROCEDURE TestMethod()
    
     Info("ok")
    

    And in Class2 this:

    PROCEDURE NewClass(oClass1 is dynamic object)
    
     oClass1.TestMethod()
    

    So when I call Class1.Create() It shows "ok"