Hi folks,
I'm at that point, once again, where I seem to be at the end of my bag of trick and could use some new ideas.
I have a nagging "Datatype Mismatch" error that shows up under very specific conditions in my application. The error seems to have no consequence. Ignoring it allows the program to continue and all data is saved as expected. But the error is obviously disconcerting to the users.
The error occurs when exiting one form, and returning control to another, but ONLY if a particular action has taken place (involving a third form). Just to give you some context, the first form is a contact screen. The second is a customer profile screen, and the third form is a sales rep and commission rate screen. The action that causes the problem is the assignment of a new sales rep to a customer contact.
By the way, if you remain in the contact screen and move on to another record and again assign a new sales rep, the error does NOT occur.
This is too deep to expect anyone to look at my code or to try to present something that reproduces the problem. Rather, I wanted to ask for strategies for nailing this error down. I can't step through the code in the debugger and find a statement that generates the error. As best as I can tell, it occurs literally at the time control is returned to the DO FORM ... command for the first level Contact screen. F.Y.I. That line of code looks like this:
Yep! This is stuff that goes back to the conversion from Foxpro 2.6 to VFP 3. It's been working fine for 20 years!
A little more background: The contact screen can call itself. That's why the form is linked to a name held in the CNTCT_FORM[] array. At the point of the failure, the expressions used in this command are out of context. (The debugger shows "Expression can not be evaluated.") But this is the case when you look at these expressions while control is still in the called procedure. The debugger clearly doesn't refresh all of the watched expressions as I step through this process anyway.) I feel like I am already placing too much emphasis on this line of code, but wanted to provide as clear a picture as I could.
So, I have an error that pops up in a very particular place, under very specific conditions, but doesn't seem to be a specific line of code. I have tried using the event logger to see what events are firing between the last line of the called procedure and returning to the contact form. I have also used _VFP.LanguageOptions to check variable declarations to see if something is getting clobbered in a lower-level procedure. I have found nothing so far.
So, I am looking for new strategies to trap this error. I think after all these years that I know a little something about Foxpro. Then I run into a problem like this and feel like a complete idiot. Your thoughts would be appreciated.
Thanks,
Ron
I'm at that point, once again, where I seem to be at the end of my bag of trick and could use some new ideas.
I have a nagging "Datatype Mismatch" error that shows up under very specific conditions in my application. The error seems to have no consequence. Ignoring it allows the program to continue and all data is saved as expected. But the error is obviously disconcerting to the users.
The error occurs when exiting one form, and returning control to another, but ONLY if a particular action has taken place (involving a third form). Just to give you some context, the first form is a contact screen. The second is a customer profile screen, and the third form is a sales rep and commission rate screen. The action that causes the problem is the assignment of a new sales rep to a customer contact.
By the way, if you remain in the contact screen and move on to another record and again assign a new sales rep, the error does NOT occur.
This is too deep to expect anyone to look at my code or to try to present something that reproduces the problem. Rather, I wanted to ask for strategies for nailing this error down. I can't step through the code in the debugger and find a statement that generates the error. As best as I can tell, it occurs literally at the time control is returned to the DO FORM ... command for the first level Contact screen. F.Y.I. That line of code looks like this:
Code:
DO FORM "contact.scx" NAME cntct_form[cntctlevel] LINKED &_cparmstr TO m._rval
Yep! This is stuff that goes back to the conversion from Foxpro 2.6 to VFP 3. It's been working fine for 20 years!
A little more background: The contact screen can call itself. That's why the form is linked to a name held in the CNTCT_FORM[] array. At the point of the failure, the expressions used in this command are out of context. (The debugger shows "Expression can not be evaluated.") But this is the case when you look at these expressions while control is still in the called procedure. The debugger clearly doesn't refresh all of the watched expressions as I step through this process anyway.) I feel like I am already placing too much emphasis on this line of code, but wanted to provide as clear a picture as I could.
So, I have an error that pops up in a very particular place, under very specific conditions, but doesn't seem to be a specific line of code. I have tried using the event logger to see what events are firing between the last line of the called procedure and returning to the contact form. I have also used _VFP.LanguageOptions to check variable declarations to see if something is getting clobbered in a lower-level procedure. I have found nothing so far.
So, I am looking for new strategies to trap this error. I think after all these years that I know a little something about Foxpro. Then I run into a problem like this and feel like a complete idiot. Your thoughts would be appreciated.
Thanks,
Ron