Re: Formatting a string for proper calculation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Frankenbach (sendnospam_at_sendnospam.net)
Date: 09/05/04


Date: Sun, 5 Sep 2004 12:15:00 -0500

Edhy,

Go to the FoxProWiki topic
http://fox.wikis.com/wc.dll?Wiki~WikiAdvancedSearch and download the zip
file I posted there.

The code in there takes algebraic logical expressions (InFix notation) and
converts them to RPN (PostFix notation). You should be able to convert the
operators handled: and or not () to * / + - (). * / should be handled like
AND, + - should be handled like OR. A unary minus like -x should be handled
like NOT.

The code in the WikiSearch method that evaluates the RPN is a lot more
complex than what you'll need to use because it's using SQL statements.
Yours can be a simple + - / * of the two operands on the stack.

-- 
df - Microsoft MVP FoxPro    http://www.geocities.com/df_foxpro
"Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message 
news:Ol3KTR2kEHA.3648@TK2MSFTNGP09.phx.gbl...
> I am checking information about RPN, I think it really does apply to my 
> situation.  Do you know of any library or ActiveX that would help me get 
> the results in RPN?


Relevant Pages

  • Re: Calculator wrong
    ... It does not have an enter button, so it does not do RPN. ... if you have a calculator that uses infix notation and does not ... your calculator is not RPN. ... winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131 ...
    (sci.math)
  • Re: RPN Calculator
    ... Thommy M. Malmström wrote: ... be free to download and use ... be able of RPN ... Someone who can give me a hint??? ...
    (comp.lang.java.softwaretools)