Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Result of an expression included in a string variable
Message
 
À
30/07/2001 13:06:33
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00537303
Message ID:
00537683
Vues:
15
Hi!
First, add to project references Microsoft Scripting Runtime. Second,
Dim oScript As New ScriptControl
oScript.Language = "VBScript"
result = oScript.Eval("(1+5)/3")
MsgBox result
What's all!

>Is somebody can tell me if it's possible to get the numeric result of a mathematical expression and/or Visual basic function included in a string variable.
>ex.: sString1 = "1/2" result : 0.5
>or sString1 = "(1+5) /3" result : 2
>or sString1 = "Abs(-3.445)" result : 3.445
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform