Announcement

Collapse
No announcement yet.

can a CLASS METHOD call itself?

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

  • can a CLASS METHOD call itself?

    well, can it?

  • #2
    I think so.. using Me.
    hellobasic

    Comment


    • #3
      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
      Forum: http://www.jose.it-berater.org/smfforum/index.php

      Comment


      • #4
        'Course it can, silly ME!

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

        Comment

        Working...
        X