Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clipper's aEval equivalent in VFP
Message
De
15/05/2001 21:02:29
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00507524
Message ID:
00507645
Vues:
12
>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 <...>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform