home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 August
/
Chip_1999-08_cd.bin
/
sharewar
/
visds
/
Calc.DSC
< prev
next >
Wrap
Text File
|
1999-05-02
|
2KB
|
97 lines
Title Calculator
DIALOG CREATE,Calculator,100,100,142,204
DIALOG ADD,STYLE,Display,LCDMINI,10,BR,BLACK,CYAN
DIALOG ADD,Edit,RES,10,10,120,,0,DISPLAY
DIALOG ADD,BUTTON,MC,50,10,24,24
DIALOG ADD,BUTTON,MR,50,42,24,24
DIALOG ADD,BUTTON,MA,50,74,24,24,M+
DIALOG ADD,BUTTON,C,50,106,24,24,
DIALOG ADD,BUTTON,N7,80,10,24,24,7
DIALOG ADD,BUTTON,N8,80,42,24,24,8
DIALOG ADD,BUTTON,N9,80,74,24,24,9
DIALOG ADD,BUTTON,FD,80,106,24,24,/
DIALOG ADD,BUTTON,N4,110,10,24,24,4
DIALOG ADD,BUTTON,N5,110,42,24,24,5
DIALOG ADD,BUTTON,N6,110,74,24,24,6
DIALOG ADD,BUTTON,FX,110,106,24,24,*
DIALOG ADD,BUTTON,N1,140,10,24,24,1
DIALOG ADD,BUTTON,N2,140,42,24,24,2
DIALOG ADD,BUTTON,N3,140,74,24,24,3
DIALOG ADD,BUTTON,FM,140,106,24,24,-
DIALOG ADD,BUTTON,N0,170,10,24,24,0
DIALOG ADD,BUTTON,NZ,170,42,24,24,.
DIALOG ADD,BUTTON,FE,170,74,24,24,=
DIALOG ADD,BUTTON,FP,170,106,24,24,+
DIALOG SHOW
%R = 0
%M = 0
goto UPDATE
:evloop
wait event
if @equal(%R,0)
%R =
end
%E = @event()
%K = @substr(%E,2,2)
if @equal(%K,Z)
%R = %R.
goto UPDATE
end
if @greater(@pos(%K,0123456789),0)
%R = %R%K
goto UPDATE
end
if @greater(@pos(%K,PMDXE),0)
gosub OPERATE
if @equal(%K,E)
%O =
else
%O = %K
end
goto evloop
end
goto %E
:CLOSE
exit
:CBUTTON
%R = 0
%P = 0
%O =
goto UPDATE
:MCBUTTON
%M = 0
goto evloop
:MABUTTON
if %R
%M = @fadd(%M,%R)
else
%M = @fadd(%M,%P)
end
goto evloop
:MRBUTTON
%R = %M
:UPDATE
dialog set,RES,%R
goto evloop
:OPERATE
if %R
if @equal(%O,P)
%P = @fadd(%P,%R)
end
if @equal(%O,M)
%P = @fsub(%P,%R)
end
if @equal(%O,D)
%P = @fdiv(%P,%R)
end
if @equal(%O,X)
%P = @fmul(%P,%R)
end
if @null(%O)
%P = %R
end
end
%R =
dialog set,RES,%P
exit