Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can VB do this?
Message
De
12/01/2001 09:41:03
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Can VB do this?
Divers
Thread ID:
00462911
Message ID:
00462911
Vues:
59
Hi VB Gurus (I hope),

I want to create a function that can execute a formula that gets passed in as a parameter. In VFP, I can simply use the EVAL function or if necessary, the ill spoken macro substitution character.

In VFP my code would look something like this:

nValueA = 2
nValueB = 3
nValueC = 6
cCalcString = "(nValueA + nValueB) * nValueC"

nResult = EVAL(cCalcString) && nResult is 30

How would I do this in VB? I'd rather not hard-code every formula (there's over 100) if possible.

Thanks for your help!

-JT
Jeff Trockman, MCP
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform