home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
text
/
textra
/
scripts
/
eval.textra
< prev
next >
Wrap
Text File
|
1995-02-27
|
2KB
|
52 lines
/*******************************************************************
* TEXTRA AREXX script -- Mike Haas, 1991, All Rights Reserved. *
* Freely distributable ONLY as a component of the TEXTRA package. *
* This banner may not be removed or altered (improvements to the *
* actual program welcome). Please document and send to me. *
* !!! PLACE THIS FILE IN YOUR REXX: DIRECTORY !!! *
*******************************************************************/
/*** Thanks (ONCE AGAIN) to Dr. Martin Kees ***/
/* evaluate a selected (pure math) expression */
/* TO USE...
Select the text that comprises the mathematical expression (even
if it spans several lines). Then launch this script.
TEXTRA will tell you the answer!
For example, double-click on this --> 4*2.1
and then execute this script.
00001 15-dec-91 mdh Added 'action' argument initially for 'replace'
*/
options results
parse arg action /* get the argument 00001 */
if (action == "") then action = notify /* set notify as default 00001 */
expression= 'EX= '
get select text
parse var result num thisselect
if num='NO' then exit
expression= expression thisselect
do until num=0
get select next
parse var result num thisselect
expression= expression thisselect
end
interpret expression
if (action == "replace") then /* check for 'replace' 00001 */
text ex
else do
val= "The value is: " ex
notify '"' val '"'
end