home *** CD-ROM | disk | FTP | other *** search
- /*
- @BCalculator @P@ICopyright Gold Disk Inc., February, 1992
-
- This Genie allows you to evaluate one-line mathematical expressions.
- */
- if ~show(l, "gdarexxsupport.library") then
- if ~addlib("gdarexxsupport.library", 0, -30) then
- exit_msg("Please install the gdarexxsupport.library in your Libs: directory before running this Genie!")
- signal on error
- signal on syntax
-
- call ppm_AutoUpdate(0)
-
- defvalue = getclip(ppm_calval)
- cr = pos('0a'x,defvalue)
- if cr ~= 0 then defvalue = left(defvalue,cr-1)
- command = ppm_GetForm("Enter Calculation",40, "Expression =:"defvalue)
- if command = '' then exit_msg()
-
- interpret "returnval = "command
- call setclip(ppm_calval, returnval)
-
- call exit_msg(command" = "returnval)
-
- error:
- syntax:
- do
- if rc = 16 then exit_msg()
- exit_msg(command ": "errortext(rc))
-
- end
-
-
- exit_msg:
- do
- parse arg message
-
- if message ~= '' then call ppm_Inform(1, message,)
- call ppm_AutoUpdate(1)
- exit
- end
-
-
-