Re: Evaluate an string.
Posted in 1998
Eval a 4gl statement within a 4gl module? No can do, *but* I can tell you how to dynamically execute perl code within a 4gl application. Yeah, Yeah, you wanted 4gl, but perl should be good enough to parse an expression, if this is all you want. It is also a fairly simple and almost portable way to add to 4gl tons of features like regexps, file or sockets (btw, find sockets for 4gl in my humble site) user group and password functions and indeed the whole bunch of goodies described in perlfunc. Sounds interesting? Have a look at the perlembed man page... Ciao, Marco ______________________________________________________________________________ Marco Greco <marco@informix.com> Standard disclaimers apply! Informix faq http://www.iiug.org/techinfo/faq/informix.htm 4glworks http://www.ctonline.it/~marcog Informix on Linux http://www.ctonline.it/~marcog/ifmxlinux.htm 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=3D'var1+var2*var3' > > Could I get something like this: > > num=3Deval cad > > So, if var1,var2 and var3 are integers, and its values are 1,2 and 3, the = > value of num would be 6. > > Thanks in advance.