Booleanist59
Programmer
I'm working on a VFP6 app I inherited and I've come across something I can't reconcile.
The grid's record has the usual mix of text, numeric, dates, and a few check boxes in it. I added a field in the underlying table for a phone number (14 char) with no formatting and added it at the end of the grid as the last field. The way the code for a cut and paste menu drop down system works to move appointments around, it replaces the date with the date from the new schedule date when the record gets pasted on a day. This date does not exist in the grid itself of appointments, only in the record in the underlying table for sorting with the time from the option boxes. The problem is the phone number field is coming up with defaulted date delimiters in that cell. I've even recompiled the project to ensure that the new directory move is not affecting this.
This grid is convinced it's a date even though the control sources are all showing the phone field. It displays the schedule's date in the phone field. But when I captured (Cut) the appointment, the _cliptext contents after the cut show the partial phone number but the spacing is off. It's a little odd as the phone number appears in the text string I "cut" when I cut the record from the grid. I suspect there are some extra characters in (spaces) ahead of it (in front of the phone number) and that phone number is getting truncated a few digits off the end of the manually entered phone# from the table's dummy records. How does the date show in the cell but the cut finds the phone number in the record?
I think I might be better off re-writing it long-hand but I figure I'd throw it out there for the VFP community to see if I can learn something from this bizarre behavior.
There are no formatting or input masks in use, all of the max length params for the cells were left at 0. Where the date delimiters " / / " are coming from in the phone field I added onto the grid- I have no idea at this point. When the grid gets to my dummy records, it shows the schedule day's date in the phone cell of the grid. The cut and paste prg's code is included below. Why the truncated phone number is there is a curiousity to tempting to walk away from. Any suggestions or comments would be appreciated.
Thanks for your time,
Dave
**********************************************
* CUT.PRG
************************************************************
PASTE.PRG
append blank
do case
case _screen.activeform.caption = "GA/TANF Agency Interviews" or _screen.activeform.caption = "NPA/MED Phone Interviews"
repl name with subs(_cliptext, 1, 40), ;
casenum with subs(_cliptext, 41, 7), ;
initials with subs(_cliptext, 48 ,2), ;
homeless with iif(subs(_cliptext, 50, 1) = "1", .t., .f.), ;
address with subs(_cliptext, 51, 30), ;
address1 with subs(_cliptext, 81, 30), ;
city with subs(_cliptext, 111, 30), ;
state with subs(_cliptext, 141, 2), ;
zip with subs(_cliptext, 143, 10), ;
noshow with iif(subs(_cliptext, 153, 1) = "1", .t., .f.), ;
ssn with subs(_cliptext, 154, 11), ;
dob with ctod(subs(_cliptext, 165, 8)), ;
phone with subs(_cliptext, 173,14) ;
date with m.newDate ;
do case
case _screen.activeform.optiongroup1.value = 1
repl time with "8:45"
case _screen.activeform.optiongroup1.value = 2
repl time with "9:45"
case _screen.activeform.optiongroup1.value = 3
repl time with "10:45"
case _screen.activeform.optiongroup1.value = 4
repl time with "12:45"
case _screen.activeform.optiongroup1.value = 5
repl time with "1:45"
case _screen.activeform.optiongroup1.value = 6
repl time with "2:45"
endcase
case
otherwise
*!* blah blah blah
endcase
return
* The 2nd mouse gets the cheese
The grid's record has the usual mix of text, numeric, dates, and a few check boxes in it. I added a field in the underlying table for a phone number (14 char) with no formatting and added it at the end of the grid as the last field. The way the code for a cut and paste menu drop down system works to move appointments around, it replaces the date with the date from the new schedule date when the record gets pasted on a day. This date does not exist in the grid itself of appointments, only in the record in the underlying table for sorting with the time from the option boxes. The problem is the phone number field is coming up with defaulted date delimiters in that cell. I've even recompiled the project to ensure that the new directory move is not affecting this.
This grid is convinced it's a date even though the control sources are all showing the phone field. It displays the schedule's date in the phone field. But when I captured (Cut) the appointment, the _cliptext contents after the cut show the partial phone number but the spacing is off. It's a little odd as the phone number appears in the text string I "cut" when I cut the record from the grid. I suspect there are some extra characters in (spaces) ahead of it (in front of the phone number) and that phone number is getting truncated a few digits off the end of the manually entered phone# from the table's dummy records. How does the date show in the cell but the cut finds the phone number in the record?
I think I might be better off re-writing it long-hand but I figure I'd throw it out there for the VFP community to see if I can learn something from this bizarre behavior.
There are no formatting or input masks in use, all of the max length params for the cells were left at 0. Where the date delimiters " / / " are coming from in the phone field I added onto the grid- I have no idea at this point. When the grid gets to my dummy records, it shows the schedule day's date in the phone cell of the grid. The cut and paste prg's code is included below. Why the truncated phone number is there is a curiousity to tempting to walk away from. Any suggestions or comments would be appreciated.
Thanks for your time,
Dave
**********************************************
* CUT.PRG
if _screen.activeform.caption = "GA/TANF Agency Interviews" or _screen.activeform.caption = "NPA/MED Phone Interviews"
_cliptext = name + casenum + initials + iif(homeless, "1", "0") + address + address1 + city + state + zip + iif(noshow, "1", "0") + ssn + dtoc(dob) + phone
delete
else
*!* delete
endif
_screen.activeform.refresh
return_cliptext = name + casenum + initials + iif(homeless, "1", "0") + address + address1 + city + state + zip + iif(noshow, "1", "0") + ssn + dtoc(dob) + phone
delete
else
* OTHER SCHEDULES
*!* _cliptext = name + casenum + folder + arrived + source + assigned + called + left + worker + dtoc(completed)*!* delete
endif
_screen.activeform.refresh
************************************************************
PASTE.PRG
append blank
do case
case _screen.activeform.caption = "GA/TANF Agency Interviews" or _screen.activeform.caption = "NPA/MED Phone Interviews"
repl name with subs(_cliptext, 1, 40), ;
casenum with subs(_cliptext, 41, 7), ;
initials with subs(_cliptext, 48 ,2), ;
homeless with iif(subs(_cliptext, 50, 1) = "1", .t., .f.), ;
address with subs(_cliptext, 51, 30), ;
address1 with subs(_cliptext, 81, 30), ;
city with subs(_cliptext, 111, 30), ;
state with subs(_cliptext, 141, 2), ;
zip with subs(_cliptext, 143, 10), ;
noshow with iif(subs(_cliptext, 153, 1) = "1", .t., .f.), ;
ssn with subs(_cliptext, 154, 11), ;
dob with ctod(subs(_cliptext, 165, 8)), ;
phone with subs(_cliptext, 173,14) ;
date with m.newDate ;
do case
case _screen.activeform.optiongroup1.value = 1
repl time with "8:45"
case _screen.activeform.optiongroup1.value = 2
repl time with "9:45"
case _screen.activeform.optiongroup1.value = 3
repl time with "10:45"
case _screen.activeform.optiongroup1.value = 4
repl time with "12:45"
case _screen.activeform.optiongroup1.value = 5
repl time with "1:45"
case _screen.activeform.optiongroup1.value = 6
repl time with "2:45"
endcase
case
*case 2 ...
otherwise
*!* blah blah blah
endcase
* The 2nd mouse gets the cheese