This is a multi-part message in MIME format.
------=_NextPart_000_0004_01BDE881.D6E37CE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
I have a 4GL function that evaluates arithmetic expressions using polish
notation. If you are interested in it, just let me know.
------=_NextPart_000_0004_01BDE881.D6E37CE0
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment
Reply-To: <kagel@bloomberg.net>
From: "Art S. Kagel" <kagel@bloomberg.net>
Sender: <owner-informix-list@iiug.org>
To: <informix-list@iiug.org>
Subject: Re: Evaluate an string.
Date: Thu, 24 Sep 1998 13:11:01 -0400
Organization: Bloomberg LP
Message-ID: <360A7D25.663C@bloomberg.net>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-From_: owner-informix-list@iiug.org Thu Sep 24 06:11:08 1998
X-List-Gateway: comp.databases.informix
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Importance: Normal
Juan Manuel Hernandez del Olmo wrote:
>
> Evaluate an string.
> ------------------------------
> I would know if it is possible, in 4GL, to evaluate an string. For =
> example:
>
> If I have:
>
> let cad='var1+var2*var3'
>
> Could I get something like this:
>
> num=eval cad
>
> So, if var1,var2 and var3 are integers, and its values are 1,2 and 3, the
=
> value of num would be 6.
Actually 1+2*3 is either 7 or 9 depending on the order of evaluation.
Using standard rules that would be 7.
Anyway... No you cannot do this. You will have to build your own
expression parser for this.
Art S. Kagel
------=_NextPart_000_0004_01BDE881.D6E37CE0--