Public Function InfixToPostfix( _ ByVal vExpr As Variant _ ) As Variant
? InfixToPostfix("34 + 45 * 91") 34 45 91 * + ? InfixToPostfix("2 ^ 3 ^ 4 + 5") 2 3 4 ^ ^ 5 + ? InfixToPostfix("A * ( B + C ) + D") A B C + * D + ? InfixToPostfix("+ A") A + ? InfixToPostfix("A / B ^ C + D * E - A * C") A B C ^ / D E * + A C * - ? InfixToPostfix("A + B") A B + ? InfixToPostfix("A + 0 - B") A 0 + B - ? InfixToPostfix("A * % ( D + C )") A * % D C + ? InfixToPostfix("A + B * % G * H") A B * + G % H * ? InfixToPostfix("% ( D + F ) * 2") % D F + 2 *See also:
InfixToPrefix Function InfixToBasic Function InfixToPostfixInComingPriority Function InfixToPostfixInStackPriority FunctionNote: This function recognizes the following operators and functions (listed from highest precedence to lowest):
ABS, ASIN, ATAN, COS, LN, SIGN, SIN, SQRT, TAN ^ *, / \, MOD +, - (The functions at the top of this list have the highest precedence and the open parentheses character has the lowest precedence (and functions/operators on the same line have the same precedence). This function assumes that all other alphanumeric words represent variables or numeric constants.
vExpr: String containing the infix-format algebraic expression which will be converted to Postfix. Function returns Null if vExpr is Null or cannot be fixed up to a String.
Note: Function will not return an error if the algebraic (infix) expression is ill-formed; it will instead return an ill-formed Postfix expression.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.