Re: Evaluate an string.
Posted in 1998
In article <6ue0hk$cd3$1@news.xmission.com>, Jonathan Leffler <jleffler@informix.com> writes > >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. i.e. it's 9 but read upsidr down (1+2)*3 = 9!!! > >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 > -- David Williams Maintainer of the Informix FAQ Primary site (Beta Version) http://www.smooth1.demon.co.uk Official site http://www.iiug.org/techinfo/faq/faq_top.html I see you standin', Standin' on your own, It's such a lonely place for you, For you to be If you need a shoulder, Or if you need a friend, I'll be here standing, Until the bitter end... So don't chastise me Or think I, I mean you harm... All I ever wanted Was for you To know that I care