Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with calling function

Status
Not open for further replies.

OldtTimerDon

Programmer
Oct 6, 2012
34
US
Imagine a personnel file containing fields empno, fname, m_init, lnane, addr, st, city, zip, etc. A related file (Recognition.dbf) contains empno, award_code, license_code, and year achieved. The codes for licenses and awards are 3 characters and are translated in the Awards.dbf file
When the user seeks an employee, either by using find, next, or previous, my "Do ParseIt routine with empno" queries the Awards table for only that employee's data and expands the awards and license codes into an array. That array is then processed for conditions and based on those conditions accumulated to a variable myText which is then returned.

I have tested the ParseIt routine separately and it does exactly what is desired. My problem concerns where the "Do ParseIt routine with empno" should be on the employee form. As aa test, I added it to the click event of the Next button. This failed with the message "no update tables are specified. Use the table property of the cursor."

Note: My employee form has an editbox with a control source of "Thisform.myText" which is a property of the employee form.

I don't understand the error message but I am aware that error messages don't always relate to the problem. To restate the problem, as a user changes records, myText should show what awards and licenses have been achieved. (Some employees will have none.)

VFP is good brain cell medication!

Don Lawrence
Sun City, AZ, USA
 
The only time a Breakpoint works is when the TRACE Window is already open and ready to Suspend code execution.

True, but the action of setting a breakpoint itself opens the debugger. It's not as if you have to remember to do it. (Although I take you point about it slowing down execution if you leave it open; that is definitely true.)

... if you forget to remove or comment out the SET STEP ON commands, yes they will be distributed in the code, but they will only execute when in the Development Mode - otherwise they will not execute.

Yes, I realise that. It's why I was careful to say that SET STEP ON will be present when you distribute the application, noth that they will execute when you distribute the application. But I still like being able to remove all the breakpoints in one fell swoop, which you can't do with SET STEP ON.

Don, don't let this discussion confuse you. The point is to learn to use the debugger, and, in particular, to step through your code. Whether you initiate that with a breakpoint or SET STEP ON is not the central argument.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top