Re: Evaluate an string.
Posted in 1998
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
On Thu, 24 Sep 1998, Juan Manuel Hernandez del Olmo wrote: > I would know if it is possible, in 4GL, to evaluate an string [...] > > let cad='var1+var2*var3' > > Could I get something like this: > > num=eval cad No. Your closest approach is to use I4GL-ID, which can evaluate such expressions, but it is hardly a general solution. > So, if var1,var2 and var3 are integers, and its values are 1,2 and 3, > the value of num would be 6. Exactly how would you want this bug to work? Most implementations would yield 7 :-) Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn