Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic COM question
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01057884
Message ID:
01057899
Views:
12
Jaime,
This works for me:
m1 = CREATEOBJECT("Test")

? m1.Test("MyFunc1","func1")
? m1.Test("MyFunc2","func2")


DEFINE CLASS Test AS Custom
    FUNCTION Test(a1 AS String, a2 AS String) AS String
    RETURN EVALUATE("this."+a1+"('"+a2+"')")
    
    FUNCTION MyFunc1(a1)
    RETURN "Function 1 "+a1

    FUNCTION MyFunc2(a1)
    RETURN "Function 2 "+a1

ENDDEFINE
this also:
m1 = CREATEOBJECT("Test")

? m1.Test("MyFunc1","func1")
? m1.Test("MyFunc2","func2")


DEFINE CLASS Test AS Custom
    FUNCTION Test(a1 AS String, a2 AS String) AS String
    LOCAL cTest
    cTest = "this."+a1+"('"+a2+"')"
    RETURN &cTest.
    
    FUNCTION MyFunc1(a1)
    RETURN "Function 1 "+a1

    FUNCTION MyFunc2(a1)
    RETURN "Function 2 "+a1

ENDDEFINE
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform