home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************
- * 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.
-
- */
-
- options results
-
- 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
- val= "The value is: " ex
- notify '"' val '"'
-