home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
calc
/
newcalc.prg
Wrap
Text File
|
1988-03-09
|
2KB
|
112 lines
* Program......:.PRG
* Author.......: Glenn R. Abelson
* Date(s)......: 12/01/86
* Notice.......: Copyright 1986, Glenn Abelson Inc., All Rights Reserved
* Notes........:
*
*
*
SET TALK OFF
PUBLIC CLIPPER
IF CLIPPER
SAVE SCREEN TO MSCREEN
ENDIF
*** display text & vars ***
@ 09,00 CLEAR TO 21,27
@ 09,00 SAY "┌──────────────────────────┐"
@ 10,00 SAY "│ │"
@ 11,00 SAY "╞════════════╤═════════════╡"
@ 12,00 SAY "│Q to quit │ │"
@ 13,00 SAY "├─────┬──────┼──────┬──────┤"
@ 14,00 SAY "│ 7 │ 8 │ 9 │ * │"
@ 15,00 SAY "├─────┼──────┼──────┼──────┤"
@ 16,00 SAY "│ 4 │ 5 │ 6 │ / │"
@ 17,00 SAY "├─────┼──────┼──────┼──────┤"
@ 18,00 SAY "│ 1 │ 2 │ 3 │ + │"
@ 19,00 SAY "├─────┼──────┼──────┼──────┤"
@ 20,00 SAY "│ C │ 0 │ = │ - │"
@ 21,00 SAY "└─────┴──────┴──────┴──────┘"
**********************
MNUM = 0
MTOT = 0.00
MSIGN = SPACE(1)
MSTART = .T.
MFIRST = .T.
@ 12,14 GET MNUM PICTURE '99999999999'
READ
@ 10,26 GET MSIGN
READ
IF MSIGN $ "Qq"
EXIT
ENDIF
DO WHIL .T.
IF .NOT. MSTART
IF .NOT. MFIRST
@ 10,26 GET MSIGN
READ
IF MSIGN $ "Qq"
EXIT
ENDIF
ENDIF
MFIRST = .F.
@ 12,14 GET MNUM PICTURE '99999999999'
READ
ENDIF
MSTART = .F.
DO CASE
CASE MSIGN $ "cC"
MNUM = 0
MTOT = 0
@ 10,3 SAY MTOT
LOOP
CASE MSIGN = "+"
MOLDSIGN = "+"
MTOT = MTOT + MNUM
@ 10,3 SAY MTOT
CASE MSIGN = "-"
MOLDSIGN = "-"
MTOT = MTOT - MNUM
@ 10,3 SAY MTOT
CASE MSIGN = "*"
MOLDSIGN = "*"
IF MTOT <> 0
MTOT = MTOT*MNUM
ELSE
MTOT = MNUM
ENDIF
@ 10,3 SAY MTOT
CASE MSIGN = "/"
MOLDSIGN = "/"
IF MTOT <> 0
MTOT = MTOT / MNUM
ELSE
MTOT = MNUM
ENDIF
@ 10,3 SAY MTOT
CASE MSIGN = "="
IF MOLDSIGN = "+"
MTOT = MTOT + MNUM
ENDIF
IF MOLDSIGN = "-"
MTOT = MTOT - MNUM
ENDIF
IF MOLDSIGN = "*"
MTOT = MTOT * MNUM
ENDIF
IF MOLDSIGN = "/"
MTOT = MTOT / MNUM
ENDIF
OTHERWISE
LOOP
ENDCASE
ENDDO
IF CLIPPER
RESTORE SCREEN FROM MSCREEN
ENDIF