@ 18,0
@ 16,0
@ 2,54 say '|------------------------|'
@ 3,54 say '| CALCULATOR             |'
@ 4,54 say '|                   fcn  |'
@ 5,54 say '| |--------------| |---| |'
@ 6,54 say '| |              | |   | |'
@ 7,54 say '| |______________| |___| |'
@ 8,54 say '|                        |'
@ 9,54 say '| A  Add                 |'
@ 10,54 say '| S  Subtract            |'
@ 11,54 say '| X  Multiply            |'
@ 12,54 say '| D  Divide              |'
@ 13,54 say '| M  Memory Add          |'
@ 14,54 say '| N  Memory Subtract     |'
@ 15,54 say '| R  Return Memory       |'
@ 16,54 say '| Z  Memory Clear        |'
@ 17,54 say '| C  Clear               |'
@ 18,54 say '| T  Total               |'
@ 19,54 say '| Q  Quit                |'
@ 20,54 say '|                        |'
@ 21,54 say '|________________________|'
STOR ' ' to function
STOR 0.00 to operator
STOR 0.00 to total
STOR 0.00 to memory
@ 6,57 get operator picture '999999999.99'
READ
STOR total+operator to total
DO WHIL !(function)#'Q'
STOR ' ' to function
@ 6,74 get function picture 'X'
READ
IF val(function)>0 .or. function='0'
STOR function to option
DO changeop
RETU
ENDI
DO CASE
CASE !(function)='M'
STOR memory+total to memory
SET intensity off
@ 3,76 say chr(27)+chr(94)
@ 3,76 say 'M'
@ 3,77 say chr(27)+chr(113)
SET intensity on
CASE !(function)='N'
STOR memory-total to memory
CASE !(function)='R'
STOR memory to total
SET intensity off
@ 6,59 say memory using '9999999.99'
SET intensity on
CASE !(function)='Z'
STOR 0.00 to memory
@ 3,76 say ' '
CASE !(function)='C'
STOR 0.00 to total
STOR 0.00 to operator
@ 4,65 say '     '
@ 6,57 get operator picture '999999999.99'
READ
STOR total+operator to total
CASE !(function)='T'
SET intensity off
STOR str(total,16,2) to hold
STOR val(hold) to total
STOR total+.00 to total
@ 6,58 say &hold using '#########.##'
SET intensity on
CASE !(function)#'Q'
STOR 0.00 to operator
@ 6,57 get operator picture '999999999.99'
READ
ENDC
DO CASE
CASE !(function)='A'
STOR total+operator to total
CASE !(function)='S'
STOR total-operator to total
CASE !(function)='X'
STOR total*operator to total
CASE !(function)='D'
DO WHIL operator=0
@ 6,57 get operator picture '999999999.99'
READ
ENDD
STOR total/operator to total
ENDC
ENDD
RETU
