/* TestMath-01.rexx */

say "Dieses ARexx-Programm zeigt als"
say "Beispiel die Anwendung folgender"
say "Befehle von Mathador:"
say ""
say "'MathadorToFront'"
say "'MathadorToBack'"
say "'Calc'."
say ""

signal ON BREAK_C
address 'Mathador.Host'
options results

'MathadorToFront'

say 'Next command is: MathadorToBack'
pull yes

'MathadorToBack'
say 'Enter an expression...'
parse pull expression

'Calc' expression
say "The result from Mathador is:"
say result

do forever
   say "Please enter an ARexx-command for Mathador (exit->EXIT)"
   drop cmd
   parse pull cmd
   if  cmd = "EXIT" then leave
   drop result
   cmd
   if  rc < 1  then do
      say "The result from Mathador is:" result
   end
   else do
      say "Mathador-Error:" rc
   end
end

exit
