PalStrEvaluateToNumber

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalBoolean PalStrEvaluateToNumber( SalString sValue,
		                SalNumber nResult  )

The PalStrEvaluateToNumber method will try to evaluate a string formula and return the result as a numerical value. Possible operators are: / * + - ( )

Parameters

Name Description
SalString sValue The string holding the formula to evaluate.
SalNumber nResult The numerical value/result from the evaluation.

Returns

TRUE if the formula was successfully evaluated. FALSE otherwise.

Example

Set sValue = '1 + 3 * (4/2 + 7)'
If Not PalStrEvaluateToNumber( sValue, nResult )
   Call AlertBox( TEXT_InvalidFormula, CAPTION_Error, INFO_Ok )
C# code
if (!(Int.PalStrEvaluateToNumber(sValue, ref nValue))) 
{
	return false;
}