pareshrdoshi
Programmer
hello. i am using foxpro 2.6 for dos. i have following problem.
- i have a PAYMENT.DBF file which has 3 fields : P_Date D, party_name C (30), amt n (12, 2)
- my PAY.PRG file contains following commands :
use PAYMENT
T_Date = iif (.not. eof (), Date, ctod (''))
on key label f1 do repl_dt
on key label f2 do store_dt
browse fields date, party_name, amt freeze date
on key label f1
on key label f2
close all
clear all
return
- i have to procedures in same prg file.
PROC REPL_DT
replace P_Date with T_Date
return
PROC STORE_DT
T_Date = P_Date
return
- here objective is to replace P_Date with T_Date by pressing F1
- and T_Date can be replaced by current P_Date by pressing F2.
- it works well unless in following circumstances
e.g. P_Date = 06/09/2013 - when user is manually changing p_date
by just changing first 2 characters of P_Date to '07'. now p_date
shows as 07/09/2013. ENTER key is not yet pressed, so field is not
"exited". now if I press F2, then I want T_Date to have value of changed
P_Date i.e. 07/09/2013 - but it remains 06/09/2013 only. It may be
possible as i have not exited the P_Date field by pressing ENTER.
- so I have changed procedure store_dt routine as follows :
PROC STORE_DT
keyboard '{ENTER}'
T_Date = P_Date
- still T_Date gets old value of P_Date. The value of P_Date (and then
value of T_Date gets changed only when i press ENTER key manually and
then i press F2.
- is there any sollution to this problem. i.e. user just changes 1 or 2
chars of date, and presses F2 and new P_Date should get stored in T_Date ?
i mean if user do not press ENTER, then can we use "keyboard {ENTER}" ?
- if you guys can solve my problem, i will be highly grateful.
regards,
paresh
- i have a PAYMENT.DBF file which has 3 fields : P_Date D, party_name C (30), amt n (12, 2)
- my PAY.PRG file contains following commands :
use PAYMENT
T_Date = iif (.not. eof (), Date, ctod (''))
on key label f1 do repl_dt
on key label f2 do store_dt
browse fields date, party_name, amt freeze date
on key label f1
on key label f2
close all
clear all
return
- i have to procedures in same prg file.
PROC REPL_DT
replace P_Date with T_Date
return
PROC STORE_DT
T_Date = P_Date
return
- here objective is to replace P_Date with T_Date by pressing F1
- and T_Date can be replaced by current P_Date by pressing F2.
- it works well unless in following circumstances
e.g. P_Date = 06/09/2013 - when user is manually changing p_date
by just changing first 2 characters of P_Date to '07'. now p_date
shows as 07/09/2013. ENTER key is not yet pressed, so field is not
"exited". now if I press F2, then I want T_Date to have value of changed
P_Date i.e. 07/09/2013 - but it remains 06/09/2013 only. It may be
possible as i have not exited the P_Date field by pressing ENTER.
- so I have changed procedure store_dt routine as follows :
PROC STORE_DT
keyboard '{ENTER}'
T_Date = P_Date
- still T_Date gets old value of P_Date. The value of P_Date (and then
value of T_Date gets changed only when i press ENTER key manually and
then i press F2.
- is there any sollution to this problem. i.e. user just changes 1 or 2
chars of date, and presses F2 and new P_Date should get stored in T_Date ?
i mean if user do not press ENTER, then can we use "keyboard {ENTER}" ?
- if you guys can solve my problem, i will be highly grateful.
regards,
paresh