Thanks for the pointers Salem. The calculator is now fixed. I was so tired I probably overlooked the stack logic mismatch.

Quote Originally Posted by Salem
> else if(token == TOKRPAREN)
When you do this, you need to remove the ), not just find it.
Now for the parenthesis, can you elaborate if that is the issue? The value of ")" resides in the var called data that is passed to the function. I have not used the var data when the function goes to that conditional branch. So the ")" never goes to the stack. The function is called whenever the next token is needed.

What stumps me (at least right now) is that expressions w/ no parenthesis work ok. With parentheses is nearly ok, except for the inclusion of "(". Perhaps I need to do extra pop(s) somewhere appropriate but I'm not sure where? Either that or the string compare of the postfixStack & "(" is not working right.