That reminded me of this gem from midrange computing<rip> /* CRTCMD CMD(XCALC) */ /* PGM(*REXX) */ /* SRCFILE(library/QCMDSRC) */ /* SRCMBR(XCALC) */ /* REXSRCFILE(library/QREXSRC) */ /* REXSRCMBR(XCALC) */ CMD PROMPT('Expression Calculator') PARM KWD(EXP) + TYPE(*CHAR) + LEN(128) + MIN(1) + PROMPT('Mathmatical expression') /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Expression Calculator */ /* _____________________________________________________________ */ /* */ /* Yet another *FREEWARE* utility from Prime Suspect Software, */ /* creating slightly above average products for the */ /* enlightened masses since 1982. */ /* _____________________________________________________________ */ /* */ /* REXX Program Name... XCALC */ /* Programmer.......... Matt Sargent */ /* Internet Address.... M.SARGENT@GENIE.GEIS.COM */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ signal on syntax parse arg string parse value space(string) with "'"expression"'" interpret 'answer =' expression answer = strip(expression) '=' answer 'SNDPGMMSG MSG(&answer)' exit syntax: syntaxerr = errortext(rc) 'SNDPGMMSG MSG(&syntaxerr)' ====================================== There also was a help uim screen, but I could not find the source (looking for tapes...) Here is part of the Rexx reference http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/qbkauv00/4.3 some of the neat built in functions: d2x() is the REXX function to convert Decimal to heXdecimal. The data conversions available in the AS400 implementation of REXX are: b2x() binary to hex x2b() hex to binary c2d() character to decimal (EBCDIC) d2c() decimal to character (EBCDIC) c2x() character to hex (EBCDIC) x2c() hex to character (EBCDIC) d2x() decimal to hex x2d() hex to decimal Mixed conversion functions are also supported. For example, to multiply hexdecimal 8F times decimal 19 and receive the answer in hexdecimal format, enter the following: XCALC 'd2x(x2d(8F) * 19)' which will return the completion message: d2x(x2d(8F) * 19) = A9D ------------------------- Bryan Dietz 3X Corporation ===================================================================== From: "Norbut, Jim" <Jim.Norbut@Grubb-Ellis.com> > I thought there was a shareware program out > there somewhere that would let my brain cpu > cycles not get so taxed.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.