EVAL function
Author Message
EVAL function

In Perl (or MacPerl), we have EVAL built-in function. Suppose we have a
string of arithmetic expression like "6+5" (or something more complex), we
can evaluate the value of the string simply by:

\$str_a = "6+5";
\$int_b = EVAL (\$str_a);
PRINT \$int_b;

The output would be 11.

Do we have equivalent function in RB? If not, any suggestion of
implementation (even for more complex arithmetic expressions)?

Thanks.

/TokiOU

Sent via Deja.com http://www.*-*-*.com/

Wed, 25 Dec 2002 03:00:00 GMT
EVAL function
Actually yes .... there is a plug in to do this called ... Eval

You can get it here http://imru.bham.ac.uk/screenmath/evileval.sit.hqx

Quote:

> Organization: Deja.com - Before you buy.
> Newsgroups: comp.lang.basic.realbasic
> Date: Sat, 08 Jul 2000 15:40:34 GMT
> Subject: EVAL function

> In Perl (or MacPerl), we have EVAL built-in function. Suppose we have a
> string of arithmetic expression like "6+5" (or something more complex), we
> can evaluate the value of the string simply by:

> \$str_a = "6+5";
> \$int_b = EVAL (\$str_a);
> PRINT \$int_b;

> The output would be 11.

> Do we have equivalent function in RB? If not, any suggestion of
> implementation (even for more complex arithmetic expressions)?

> Thanks.

> /TokiOU

> Sent via Deja.com http://www.deja.com/