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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging a program !!!

Status
Not open for further replies.

ChrisAgius

Programmer
Sep 27, 2000
51
MT
Guys I need your help about this one. I need to debug a program during execution when an error pops up. I need that when an error occurs in my program a message box pops up terlling me to debug. I am using the SET STEP ON on error. But the problem is that when an error occurs and i want to debug the program the SET STEP ON only passes through the code for the error box and not from the code where the error occured. Any idea on how to debug on the line where the error occurrs. There is surely a way to do so but I am not doing the right thing.Thanks A Lot.
 
Maybe I misunderstand the question, but I guess that you need to 'step out':
In the debugger tool-bar, use the button 'step out'. This will take you out of the current method and, eventually, brings you to the offending code.

Note that SET STEP ON is not available in an executable (and will lead to an error). Diederik Vermeeren
verm1864@exact.nl
 
Use onError to pass the parameters you are interested in capturing, line number, executing code, state of current record, etc., to an error handler routine.

Use the error handler to create a unique file and write the parameters into the file with appropriate labels.

At the end of the routine you can return, retry, quit or attempt to fix the error at least for some specific errors.
 
If you run your program from within FoxPro, you should be able to see exactly what line the error occurred on as long as you have NO error handler (ON ERROR). When an error occurs, FoxPro will give you the option to SUSPEND...this will bring up the Debugger with the Trace window pointing to the line that caused the error. This will work with an .EXE file as well, but only if you run it from within FoxPro (use the DO command to run your EXE).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top