Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clipper's aEval equivalent in VFP
Message
From
15/05/2001 21:02:29
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00507524
Message ID:
00507645
Views:
13
>Is there a clipper's aEval() function equivalent in VFP ?

I would say that using polymorphism you can accomplish the same thing in VFP; this is, instead of passing/evaluating codeblocks, pass different objects that all have the same method name(s) but perform differently based on the circumstances and any parameters that may be passed (when the same method name is called).

On the other hand, you can utilize some of the VFP "automation server methods" to execute VFP command. These methods were primarily intended for "other applications" that wanted to communicate with a given VFP "application object"; however, they can also be used by the VFP app itself, eg:

m.b = "STORE 'Hello, World' TO m.a"
_VFP.DoCmd( m.b )
? m.a
_VFP.DoCmd( "MESSAGEBOX( 'Bye' )" )

For more complex cases, you could generate code on the fly using various string/file functions, compile it using COMPILE <...> and then run it via DO <...>
Previous
Reply
Map
View

Click here to load this message in the networking platform