Set objScript = CreateObject("MSScriptControl.ScriptControl") objScript.Language = "VBScript" x = "4,22+122-234+2,0" x = Replace(x, ",", ".") ' VB bruger punktum som decimaladskiller MsgBox objScript.Eval(x)
Det er nok hip som hap om man bruger: Dim sc As New MSScriptControl.ScriptControl eller: Set objScript = CreateObject("MSScriptControl.ScriptControl") Begge virker vist i VB6... :-)
Til gengæld kan 'x = Replace(x, ",", ".")' gi problemer hvis punktum benyttes som 1000-tals adskiller. Måske en 'x = Replace(x, ".", "")' før 'x = Replace(x, ",", ".")' såfremt der er sikkert at komma benyttes til decimaladskiller.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.