Aldrin, take a deep breath. It’s likely that your plugin isn’t installed correctly. The problem has nothing to do with your project.
Go to the Explorer. Open the applications folder, select the Xojo folder. You should have a plugins folder. In there you should have the Big Float plugin.
Now I have Pasted the fbplugin in the plugins folder, errors have been solved and now I can able to run the program. Thanks for the wonderful help, Let me check the output and message here. Once again Thanks for all.
The fpPlugIn does not produce NaN’s. So, this wouldn’t be the result of a BigFloat operation. That would result in one of:
fpBadInputException
fpDivideByZeroException
fpNilObjectException
fpNegativeNumberException
fpNegativeOrZeroException
fpBadEntryNumberException
fpOverflowOrNegativeException
fpPrecisionNotMetException
If you’re using the BigFloat ExpressionEvaluator class to parse and evaluate the formula, then it should catch the exception and return “NaN” not “NaN(IND)”.
In general, when you get a NaN of any type, it means that you attempted an illegal math operation such as divide by zero, square root of a negative number, logarithm of zero or negative number, etc.
I would recommend that you start with a much simpler mathematical expression for debugging, and once you’re satisfied that it’s working with a simple expression, then you can try that huge one.
Edit:
When you had stated earlier that you were trying to assign a 50000 character string value, I took that to mean that you needed to use extended precision math. Now, after looking at the formula that you’re trying to evaluate, I see that most of the constants have only 3 or 4 decimal places of precision. So, I suspect that you don’t need anything more precise than regular double precision at best.
I think, at this point, we need to get a more detailed description of exactly what you are trying to accomplish. Otherwise, we’re likely to end up going down the wrong path.
I plugged your expression into my ExpressionEvaluator example app, and the good news is that it parsed correctly. However, when evaluated it does indeed produce a NaN. I added a bit of diagnostic code to find out where this occurs and this is what it produced: Invalid result NaN occurred after 2016 operations. Operation: “/” (Division), Operands: “0.0786962” “0”
So, it’s trying to divide by zero.
I pasted your expression directly into an assignment statement in the XOJO code editor and ran it. It gives a result of 19.99723.
I don’t know why the ExpressionEvaluator produced an error. It may be due to a difference in how operator precedence is handled. I’ve noticed a difference between various software packages in how they handle precedence of the exponentiation operator.
TextArea1.Text= str(a)
[/code]
XOJO didn’t like it as a one line formula. So, I split it into a multi-line statement using the underscore character at the end of each line.
Drop a XojoScript object on your window. In Window.Open, set the script’s context to the window. That will give the script access to the properties of the window. So if you have 2 properties on the window
Result as String // your equation
ResultValue as Double // the evaluated value
Then in the window’s Open event set the context
XojoScript1.Context = self
When you have a Result string that you want to evaluate, you create a source code string similar to your hard coded code above, and pass it to the script
dim s as string = "ResultValue = " + Result
XojoScript1.Run
msgbox str(ResultValue)
[quote=418658:@Aldrin Mathias]dim Result as String // your equation
dim ResultValue as Double // the evaluated value
[/quote]
These create local variables that are not available to the script. They must be properties of the window.
@Tim Hare Thanks For the help, I tried with xojoscript and I got the expected output. But only one confusion why we are using xojoscript and it is having any disadvantages…?