2016-12-05 22:15:40 +01:00
|
|
|
/*REXX program illustrates the ability to execute code entered at runtime (from C.L.)*/
|
|
|
|
|
numeric digits 10000000 /*ten million digits should do it. */
|
2013-04-10 23:57:08 -07:00
|
|
|
bee=51
|
2015-02-20 00:35:01 -05:00
|
|
|
stuff= 'bee=min(-2,44); say 13*2 "[from inside the box.]"; abc=abs(bee)'
|
2013-04-10 23:57:08 -07:00
|
|
|
interpret stuff
|
2016-12-05 22:15:40 +01:00
|
|
|
say 'bee=' bee
|
|
|
|
|
say 'abc=' abc
|
2013-04-10 23:57:08 -07:00
|
|
|
say
|
2016-12-05 22:15:40 +01:00
|
|
|
/* [↓] now, we hear from the user. */
|
2013-04-10 23:57:08 -07:00
|
|
|
say 'enter an expression:'
|
|
|
|
|
pull expression
|
|
|
|
|
say
|
2016-12-05 22:15:40 +01:00
|
|
|
say 'expression entered is:' expression
|
|
|
|
|
say
|
2013-04-10 23:57:08 -07:00
|
|
|
|
|
|
|
|
interpret '?='expression
|
|
|
|
|
|
|
|
|
|
say 'length of result='length(?)
|
2016-12-05 22:15:40 +01:00
|
|
|
say ' left 50 bytes of result='left(?,50)"···"
|
|
|
|
|
say 'right 50 bytes of result=···'right(?, 50) /*stick a fork in it, we're all done. */
|