Hi experts,
As in windows style I would like to modify the DOS program to make it calculates automatically the TOTAL when finishing to enter the QTY or PRICE for each line.
More precise I don't want to use F9=Calculate key.
Is there any solution or because the limitation in DOS style.
Please help...thanks in advance !!!
FoxTech
Here is an example of the screen:
QTY PRICE
___ _____
___ _____
___ _____
___ _____
TOTAL:
F9=Caculate the total ESC=Exit
Here is the codes:
(TEST999.PRG)
public mqty1, mpice1, mqty2, mprice2, mtotal
mqty1 = 0
mprice1 = 0
mqty2 = 0
mprice2 = 0
mtotal = 0
Do while Lastkey() != 27
on key label F9 do CALTOTAL
Do EntryScreen
Enddo
Procedure EntryScreen
@ 4,67 say 'Qty' color +gr/b
@ 4,71 say 'Price' color +gr/b
@ 14,60 say 'Total:' color +gr/b
@ 20,1 say 'F9=Calculate Total ESC=EXIT' color +gr/b
@ 5,67 GET mqty1 pict "999"
@ 5,71 GET mprice1 PICTURE "99999.99"
@ 7,67 GET mqty2 pict "999"
@ 7,71 GET mprice2 PICTURE "99999.99"
Read
Return
PROCEDURE CALTOTAL
PUSH KEY CLEAR
mtotal = 0
mtotal = (mqty1*mprice1) + (mqty2*mprice2)
@ 14,67 say mtotal pict "99999.99"
Return
As in windows style I would like to modify the DOS program to make it calculates automatically the TOTAL when finishing to enter the QTY or PRICE for each line.
More precise I don't want to use F9=Calculate key.
Is there any solution or because the limitation in DOS style.
Please help...thanks in advance !!!
FoxTech
Here is an example of the screen:
QTY PRICE
___ _____
___ _____
___ _____
___ _____
TOTAL:
F9=Caculate the total ESC=Exit
Here is the codes:
(TEST999.PRG)
public mqty1, mpice1, mqty2, mprice2, mtotal
mqty1 = 0
mprice1 = 0
mqty2 = 0
mprice2 = 0
mtotal = 0
Do while Lastkey() != 27
on key label F9 do CALTOTAL
Do EntryScreen
Enddo
Procedure EntryScreen
@ 4,67 say 'Qty' color +gr/b
@ 4,71 say 'Price' color +gr/b
@ 14,60 say 'Total:' color +gr/b
@ 20,1 say 'F9=Calculate Total ESC=EXIT' color +gr/b
@ 5,67 GET mqty1 pict "999"
@ 5,71 GET mprice1 PICTURE "99999.99"
@ 7,67 GET mqty2 pict "999"
@ 7,71 GET mprice2 PICTURE "99999.99"
Read
Return
PROCEDURE CALTOTAL
PUSH KEY CLEAR
mtotal = 0
mtotal = (mqty1*mprice1) + (mqty2*mprice2)
@ 14,67 say mtotal pict "99999.99"
Return