Answered by:
Calculation of a string and more
Question

Answers

You have to translate your expression string to a language, that LDMath.Evaluate can understand,
That is JScript Math object for LDMath.Evaluate and
C#/VB .NET Math class for LDMath.Evaluate2
(in this case to Math.Pow)
e.g. like
str = "MATH.POWER(3,4)" TextWindow.WriteLine("strOrig: "+ str) str = Text.ConvertToUpperCase(str) ' or Text.ConvertToLowerCase(str) if you want lower case str = LDText.Replace(str, "MATH.POWER(", "Math.Pow(") ' case sensitive, here UPPER case 'str = LDRegex.Replace(str, "MATH.POWER\(", "Math.Pow(", "") ' case (in)sensitive TextWindow.WriteLine("str: "+ str) TextWindow.WriteLine("") res = LDMath.Evaluate(str) ' JScript Math object res2 = LDMath.Evaluate2(str) ' C#/VB .NET Math. class TextWindow.WriteLine("LDMath.Evaluate: "+ res) TextWindow.WriteLine("LDAMath.Evaluate2: "+ res2) TextWindow.WriteLine("")
 Edited by Pappa LapubEditor Thursday, August 31, 2017 12:37 PM
 Proposed as answer by Ed Price  MSFTMicrosoft employee, Owner Saturday, September 2, 2017 12:25 AM
 Marked as answer by Ed Price  MSFTMicrosoft employee, Owner Friday, September 15, 2017 11:32 PM

Hello, BluStars.
In my case: 3*3*3*3
Small Basic: compiles source code to binary for CLR which calling .NET Library version of Math.Power().
See Also
Nonki Takahashi
 Proposed as answer by Ed Price  MSFTMicrosoft employee, Owner Saturday, September 2, 2017 12:25 AM
 Marked as answer by Ed Price  MSFTMicrosoft employee, Owner Friday, September 15, 2017 11:32 PM
All replies

You have to translate your expression string to a language, that LDMath.Evaluate can understand,
That is JScript Math object for LDMath.Evaluate and
C#/VB .NET Math class for LDMath.Evaluate2
(in this case to Math.Pow)
e.g. like
str = "MATH.POWER(3,4)" TextWindow.WriteLine("strOrig: "+ str) str = Text.ConvertToUpperCase(str) ' or Text.ConvertToLowerCase(str) if you want lower case str = LDText.Replace(str, "MATH.POWER(", "Math.Pow(") ' case sensitive, here UPPER case 'str = LDRegex.Replace(str, "MATH.POWER\(", "Math.Pow(", "") ' case (in)sensitive TextWindow.WriteLine("str: "+ str) TextWindow.WriteLine("") res = LDMath.Evaluate(str) ' JScript Math object res2 = LDMath.Evaluate2(str) ' C#/VB .NET Math. class TextWindow.WriteLine("LDMath.Evaluate: "+ res) TextWindow.WriteLine("LDAMath.Evaluate2: "+ res2) TextWindow.WriteLine("")
 Edited by Pappa LapubEditor Thursday, August 31, 2017 12:37 PM
 Proposed as answer by Ed Price  MSFTMicrosoft employee, Owner Saturday, September 2, 2017 12:25 AM
 Marked as answer by Ed Price  MSFTMicrosoft employee, Owner Friday, September 15, 2017 11:32 PM

Hello, BluStars.
In my case: 3*3*3*3
Small Basic: compiles source code to binary for CLR which calling .NET Library version of Math.Power().
See Also
Nonki Takahashi
 Proposed as answer by Ed Price  MSFTMicrosoft employee, Owner Saturday, September 2, 2017 12:25 AM
 Marked as answer by Ed Price  MSFTMicrosoft employee, Owner Friday, September 15, 2017 11:32 PM