Announcement

Collapse
No announcement yet.

can a CLASS METHOD call itself?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chris Holbrook
    replied
    'Course it can, silly ME!

    Thanks for the prompts. I thought that only inteface methods could be called in this way.

    Leave a comment:


  • José Roca
    replied
    Yes, it can.

    Code:
    #COMPILE EXE
    #DIM ALL
    
    CLASS CFoo
    
       INSTANCE x AS LONG
    
       INTERFACE IFoo
    
       INHERIT IUNKNOWN
    
       METHOD Foo
          INCR x
          MSGBOX STR$(x)
          IF x > 2 THEN EXIT METHOD
          ME.Foo
       END METHOD
    
       END INTERFACE
    
    END CLASS
    
    
    FUNCTION PBMAIN () AS LONG
    
       local p AS IFoo
       p = CLASS "CFoo"
       p.Foo
    
    END FUNCTION

    Leave a comment:


  • Edwin Knoppert
    replied
    I think so.. using Me.

    Leave a comment:


  • Chris Holbrook
    started a topic can a CLASS METHOD call itself?

    can a CLASS METHOD call itself?

    well, can it?
Working...
X