Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding code to methods programatically?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Adding code to methods programatically?
Miscellaneous
Thread ID:
00949721
Message ID:
00949721
Views:
47
I tried doing the following:
define class myTest as Custom
   protected oTimer

   procedure Init 
      this.oTimer = createobject("Timer")
      this.oTimer.Enabled = .T.
      this.oTimer.Interval = 800
   endproc

   procedure oTimer_TIMER
      this.interval = 0
      = messagebox("This is a test")
   endproc

enddefine
Apparently I'm doing something wrong because this doesn't work.

I thought there was a way to programatically define the timer method without having to actually create a subclass of the timer. I know you can add code for _ASSIGN method of a class' property. Can you not define a method of an object property of a class?

Thanks for your help.
Next
Reply
Map
View

Click here to load this message in the networking platform