General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only