EJERCICIO (Boton de Comandos)
*-------------------------------------------------------------------------------------------
Ingresar un par de valores y haciendo uso de BOTONES DE COMANDOS (COMMAND BOTTOM) permitir la posibilidad de realizar las 4 operaciones elementales.
*-------------------------------------------------------------------------------------------
clea
control=1
do while control=1
resul=0
op=1
store 0 to a,b
define windows ventana from 1,1 to 40,80 title "CARGA DE DATOS"
activate windows ventana
@ 1,1 say "Ingrese un numero :" font "arial,12"
@ 1,16 get a font "arial,10"
@ 4,1 say "Ingrese un numero :" font "arial,12"
@ 4,16 get b font "arial,10"
@ 8,1 get op function "*H SUMA;RESTA;MULTIPLICACION;DIVISION;SALIR" size 4,15,1 font "arial,10"
read cycle
if lastkey()=27
clea
deactivate windows ventana
exit
endif
do case
case op=1
resul=a+b
case op=2
resul=a-b
case op=3
resul=a*b
case op=4
resul=a/b
case op=5
exit
endcase
@ 18,1 say "RESULTADO :" + str(resul)
wait "OPRIMA UNA TECLA PARA CONTINUAR....." windows
enddo
deactivate windows ventana
clea
return

<< Página Principal