_TITLE "Prithak's calc, mod B+ 2019-01-29" makecalculator 'draw it
_PRINTSTRING (100, 50), a$
+ " " + op$
+ " " + b$
'show current status
'get the k$
k$
= INKEY$ 'update keypresses WHILE mb
'wait until mouse button is released before handling click textIndex = 0
textIndex = textIndex + 1
k$
= MID$("123+456-789*.0=/", textIndex
, 1)
'now handle the k$
IF k$
= CHR$(8) THEN 'backspace, be nice if had mouse button too for backspace and clearing op$ = ""
op$ = k$
op$ = k$
calc:
b$ = "": op$ = ""
LINE (0, 0)-(450, 500), 2, B
'frame LINE (50, 25)-(400, 75), 2, B
'Output Screen textIndex = textIndex + 1
text$
= MID$("123+456-789*.0=/", textIndex
, 1)