Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Method code at runtime??
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00114464
Message ID:
00114467
Views:
23
>Good day to you all,
>
>Is there any way I can change the Method code of an object from the objects Init Method, or from any other place for that matter??

Changing Method Code of an object at run time is not possible. However, why not create a custom method and control what portion of the code to be executed by passing parameters as in:
PROCEDURE myobject.Init
    Thisform.MyCustomMethod('A')
ENDPROC

PROCEDURE myobject2.Valid
    Thisform.MyCustomMethod('B')
ENDPROC

PROCEDURE MycustomMethod
LPARAMETERS cBase
    DO CASE
    CASE cBase = 'A'
       CODE HERE...
    CASE cBase = 'B'
       CODE HERE...
    ETC..
    ENDCASE
ENDPROC
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform