I am trying to modify the code below which I inheirited and currently runs on Foxpro 2.6 Dos. New records are entered in the screen displayed by the @say...get statements. I want the values entered in mrec(4) and mrec(5) in one record to carry forward and be displayed during entry of the next record. Any help would be much appreciated. Sorry for the large amount of code. I don't know enough to know which part of it to leave out.
Thank you.
******************************************
use TAG_ITEM in 0 Order 1
sele phy_inv
copy stru to (tempfile)
sele 0
use (tempfile) exclusive alias TMPTAGDBF && Added alias bat 10/17/96
index on TAG_NUM TAG TAG_NUM && created index bat 10/17/96
on key label F2 do unu_tag with mrec(2),muser
**on key label F6 do wip_pop with mrec,muser
**on key label F8 mrec(9)=!mrec(9)
**on key label F9 why_not=!why_not
rr='S'
last_tag = 0
mcnt_by = ''
mchk_by = ''
why_not = .f.
DO while .t.
if !upper(rr)='E'
scatter to mrec blank
mrec(2)=iif(why_not, last_tag,0)
**mrec(7)='EA'
mrec(4)='AB'
mrec(1)=muser
**** Carry forward stk and bin values 9/17/2002
** mrec(4)=mstk
** mrec(5)=mbin
**** End of 9/17/2002 changes Did not work.
endif
clea
@ 4,15 TO 18,75 double
@ 6,20 say 'TAG NUMBER: ' GET mrec(2) pict'9999999' valid FindTag(@mrec) ERROR "" &&bat 10/17/96
@ 8,20 say 'STK: ' GET mrec(4) pict'@!' && added valid function
@ 8,32 say 'BIN/ROW: ' GET mrec(5) pict'@!'
* Skip next line 9/17/2002
* @ 8,54 say 'AREA: ' GET mrec(11) pict'@!'
* End of skip
@ 10,20 say 'ITEM : ' GET mrec(3) pict'@!'
@ 14,20 say 'QUANTITY : ' GET mrec(6) WHEN showitem(mrec(3)) valid mrec(6)<>0.or.alltrim(mrec(3))$'UV'
@ 14,56 say 'UM: ' GET mrec(7) pict'@!'
@ 16,20 say 'STATUS: ' GET mrec(8) pict'@M C,I'
@ 16,45 say 'SLOW/OBSOLETE: ' GET mrec(9) valid mrec(9)$'SO' .or. empt(mrec(9)) ;
pict'@!' mess 'S = Slow O = Obsolete Otherwise Leave Blank'
@ 23,1 say 'F2 TO ENTER UNUSED TAGS BY RANGE U=UNUSED V=VOID'
read
if !empty(mrec(3)) .and. !alltrim(mrec(3))$'UV'
if seek(mrec(3),"itm_mstr"
mrec(10)=itm_mstr->item_class
if !mrec(7)=itm_mstr->um
@ 14,56 say'UM: ' GET mrec(7) pict'@!' mess itm_mstr->um+;
' IS THE UNIT OF MEASURE FOR THIS ITEM'
read
set mess to
endif
endif
endif
If mrec(8)='I'
set message to
do wip_pop with mrec,muser
else
If !empty(mrec(3)) .and. !alltrim(mrec(3))$'UV'
if !seek(mrec(4)+mrec(5),"loc_mstr"
@ 8,20 say'STK: ' GET mrec(4) pict'@!' mess ;
'A COMPLETED PART MUST HAVE A VALID LOCATION'
@ 8,32 say'BIN/ROW: ' GET mrec(5) pict'@9'
READ
set mess to
endif
endif
endif
**@23,50 say iif(mrec(9),'** PART MARKED SLOW/OBSOLETE**','') when s/o was logical with f key
rr='S'
rr=secq(rr) && asks save,edit,cancel,quit...returns S,E,C,Q
if upper(rr)='E' .or. upper(rr)='C'
loop
else
if upper(rr)='Q'
if yesno2("Are you sure you wish to end this BATCH?"
exit && leave do while loop
endif
else
if (mrec(6)=0 .and. !alltrim(mrec(3))$'UV') .or. empty(mrec(3))
loop
endif
if !seek(mrec(2),"TMPTAGDBF"
&&bat 10/17/96
append blank
endif
mcnt_by=mrec(9)
gather from mrec
last_tag=mrec(2)+1
**** Store value of stk and bin variable to carry forward to next tag 9/17/2002
**** mstk=mrec(4)
**** mbin=mrec(5)
**** End of 9/17/2002 changes Changes did not work 9/17/2002
endif
endif
enddo
Thank you.
******************************************
use TAG_ITEM in 0 Order 1
sele phy_inv
copy stru to (tempfile)
sele 0
use (tempfile) exclusive alias TMPTAGDBF && Added alias bat 10/17/96
index on TAG_NUM TAG TAG_NUM && created index bat 10/17/96
on key label F2 do unu_tag with mrec(2),muser
**on key label F6 do wip_pop with mrec,muser
**on key label F8 mrec(9)=!mrec(9)
**on key label F9 why_not=!why_not
rr='S'
last_tag = 0
mcnt_by = ''
mchk_by = ''
why_not = .f.
DO while .t.
if !upper(rr)='E'
scatter to mrec blank
mrec(2)=iif(why_not, last_tag,0)
**mrec(7)='EA'
mrec(4)='AB'
mrec(1)=muser
**** Carry forward stk and bin values 9/17/2002
** mrec(4)=mstk
** mrec(5)=mbin
**** End of 9/17/2002 changes Did not work.
endif
clea
@ 4,15 TO 18,75 double
@ 6,20 say 'TAG NUMBER: ' GET mrec(2) pict'9999999' valid FindTag(@mrec) ERROR "" &&bat 10/17/96
@ 8,20 say 'STK: ' GET mrec(4) pict'@!' && added valid function
@ 8,32 say 'BIN/ROW: ' GET mrec(5) pict'@!'
* Skip next line 9/17/2002
* @ 8,54 say 'AREA: ' GET mrec(11) pict'@!'
* End of skip
@ 10,20 say 'ITEM : ' GET mrec(3) pict'@!'
@ 14,20 say 'QUANTITY : ' GET mrec(6) WHEN showitem(mrec(3)) valid mrec(6)<>0.or.alltrim(mrec(3))$'UV'
@ 14,56 say 'UM: ' GET mrec(7) pict'@!'
@ 16,20 say 'STATUS: ' GET mrec(8) pict'@M C,I'
@ 16,45 say 'SLOW/OBSOLETE: ' GET mrec(9) valid mrec(9)$'SO' .or. empt(mrec(9)) ;
pict'@!' mess 'S = Slow O = Obsolete Otherwise Leave Blank'
@ 23,1 say 'F2 TO ENTER UNUSED TAGS BY RANGE U=UNUSED V=VOID'
read
if !empty(mrec(3)) .and. !alltrim(mrec(3))$'UV'
if seek(mrec(3),"itm_mstr"
mrec(10)=itm_mstr->item_class
if !mrec(7)=itm_mstr->um
@ 14,56 say'UM: ' GET mrec(7) pict'@!' mess itm_mstr->um+;
' IS THE UNIT OF MEASURE FOR THIS ITEM'
read
set mess to
endif
endif
endif
If mrec(8)='I'
set message to
do wip_pop with mrec,muser
else
If !empty(mrec(3)) .and. !alltrim(mrec(3))$'UV'
if !seek(mrec(4)+mrec(5),"loc_mstr"
@ 8,20 say'STK: ' GET mrec(4) pict'@!' mess ;
'A COMPLETED PART MUST HAVE A VALID LOCATION'
@ 8,32 say'BIN/ROW: ' GET mrec(5) pict'@9'
READ
set mess to
endif
endif
endif
**@23,50 say iif(mrec(9),'** PART MARKED SLOW/OBSOLETE**','') when s/o was logical with f key
rr='S'
rr=secq(rr) && asks save,edit,cancel,quit...returns S,E,C,Q
if upper(rr)='E' .or. upper(rr)='C'
loop
else
if upper(rr)='Q'
if yesno2("Are you sure you wish to end this BATCH?"
exit && leave do while loop
endif
else
if (mrec(6)=0 .and. !alltrim(mrec(3))$'UV') .or. empty(mrec(3))
loop
endif
if !seek(mrec(2),"TMPTAGDBF"
append blank
endif
mcnt_by=mrec(9)
gather from mrec
last_tag=mrec(2)+1
**** Store value of stk and bin variable to carry forward to next tag 9/17/2002
**** mstk=mrec(4)
**** mbin=mrec(5)
**** End of 9/17/2002 changes Changes did not work 9/17/2002
endif
endif
enddo