[Coldstuff] evaluate method
Adam Cormany
coldstuff@cold.org
Mon, 14 Jan 2002 23:04:57 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0011_01C19D4F.E2A92E40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I've been trying and can't figure out how to do this on my own so =
hopefully the cold gods will smile on me tonight:)
I'm parsing some text and by the time it's all finished, I have a string =
of an equation of numbers. Is there a way to process this string to get =
the answer? For example, I have a string "1+1", is there a way to =
process this to get 2? I know about @eval or ; and I want to do exactly =
that but inside some code as a method. I've been looking at =
$programmer.eval_cmd and $programmer.evaluate but I'm lost. Am I missing =
something or is there a simple way to do <variable> =3D .<method>("1+1") =
?
------=_NextPart_000_0011_01C19D4F.E2A92E40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2712.300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I've been trying and can't figure out =
how to do=20
this on my own so hopefully the cold gods will smile on me=20
tonight:)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm parsing some text and by the time =
it's all=20
finished, I have a string of an equation of numbers. Is there a way to =
process=20
this string to get the answer? For example, I have a string "1+1", is =
there a=20
way to process this to get 2? I know about @eval or ; and I want =
to do=20
exactly that but inside some code as a method. I've been looking at=20
$programmer.eval_cmd and $programmer.evaluate but I'm lost. Am I missing =
something or is there a simple way to do <variable> =3D=20
.<method>("1+1") ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0011_01C19D4F.E2A92E40--