From: Thomas Adam Date: 2004-03-22T21:46:59+09:00 Subject: Re: [newbie] from string to operator --- Yvon Thoraval wrote: > i've a script part like that : > [...] > case operand > when "+" > setNumber(getMemory + getNumber) > when "-" > setNumber(getMemory - getNumber) > when "*" > setNumber(getMemory * getNumber) > when "/" > setNumber(getMemory / getNumber) > end > [...] > > is there a way to replace all the above with something like an eval > function : > > eval(getMemory, operand, getNumber) > > that's to say a way to transform the string operand to the operator ??? Or use the "===" operator.... -- Thomas Adam ===== "The Linux Weekend Mechanic" -- http://linuxgazette.net "TAG Editor" -- http://linuxgazette.net " We'll just save up your sins, Thomas, and punish you for all of them at once when you get better. The experience will probably kill you. :)" -- Benjamin A. Okopnik (Linux Gazette Technical Editor) ___________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html