In VB how to type a string into a computable?

Users questions:For example it: dimaasstringa = "3 +5 +8 * 5" ... ... ... ... 'on a do some processing, printa output: 48VB there are no internal function can achieve this transformation? If not, what kind of process to achieve?
Experts answer: Method 1: The ScriptControl, online there are many examples of the toolbar to add ScriptControl control method: Select the component "MicrosoftScriptControl1.0" can refer to an annex other source. Method 2: Use API functions OptionExplicitPrivateDeclareFunctionEbExecuteLineLib "vba6.dll (ByValpStringToExecAsLong, ByValUnknownn1AsLong, ByValUnknownn2AsLong, ByValfCheckOnlyAsLong) AsLongPrivateFunctionExecuteLine (sCodeAsString, OptionalfCheckOnlyAsBoolean) AsBooleanExecuteLine = EbExecuteLine (StrPtr (sCode), 0 &, 0 &, Abs (fCheckOnly)) = 0EndFunctionPrivateFunctioncalc(ByValxAsString)AsStringExecuteLine dimxasdouble ExecuteLine x= teLine "clipboard.settextx" calc = Clipboard.GetTextEndFunction call cases: DimaAsStringa = "3 +5 +8 * 5" Printcalc (a) Annex: ScriptControl get the return value. Rar
  • This information provided by the users.Thanks!