Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Evaluating a maths expression in a string?

From: mat:eurogamer at: 29-Dec-2000 18:52

Heya Ryan, RCC> Here is something to get you started...
>>> expression-string: "2 + 2"
RCC> == "2 + 2"
>>> do load expression-string
RCC> == 4 Mmm quite obvious really. expression-string: "2 / 0" either error? try [expresult: do load expression-string] [ Print "Bum expression man, get some skillz!" ][ Print rejoin ["The result was: " expresult] ] Sweet! -- Mat Bettinson - EuroGamer's Gaming Evangelist with a Goatee http://www.eurogamer.net | http://www.eurogamer-network.com