The trace window is used to follow code during a step through.
Category 3 Star Topics
Cool things in the trace window
- You can use the buttons at the top of the window to step into the next line, or step over the next line, or step out of the current procedure. See also VFP Debugger Keyboard Shortcuts.
- You can hover the mouse over a variable or property reference and a tooltip window will display the current value for that item. Including comments! You can limit what is evaluated by selecting (highlighting) text in the trace window. One use for this is verifying that an object is really an object by striping off a method call; There is no tooltip for oMyObj.init(), but if you select oMyObj, it will show "object." Use it to get the value of metadata that is enclosed in quotes: CASE TYPE("toObject.Name")... select toObject.Name, and you can get the current value. (double clicking selects words)
- Set Next Statement: little known feature that is really interesting. Once you are tracing a program, move the selection (text cursor in the trace window) to some line of code, pick “Set next statement” from the debugger menu (or from the right click menu which will also move the selection cursor). The little yellow arrow that shows the “Currently executing line of code” will move to the line specified. If you hit resume or step, that will be the line executed. Additionally, if you add two lines of code to each function:
you can change the contents of lcCommand from the watch window, set next statement to the macro expansion and execute a line of code while stepping through. This is very handy during debugging. Why not just use the command window?
- Run To Cursor works like this: Place the cursor over any line in the Trace Window and rightclick - Run To Cursor. This is a great way to move along speedily, or get out of a loop, or skip sections you're not interested in.
- You can open a procedure in the trace window with the Open icon on the debugger toolbar.
- You can cut and paste from the trace window, and all the symbols you see in the code in the Trace Window can be manipulated in the Command Window. Or copy/paste the code to another MODI COMM window where you can highlight sections of code at a time, rightclick and execute the section.
- If you suspend your program because of an incorrect variable, you can assign the variable in the command window and then resume program execution.
- You can also change the value of a variable right in the Watch or Locals windows.
- You can highlight an expression and drag it directly to the watch window.
Say you have a form with two controls, both have code in the init method. If you are in the init method of a the first control of a form and you hit "Step out", shouldn't it halt at the beginning of the init method of the second control? It doesn't. It seems that the loop that instanciates objects in a container doesn't count as a level. It should.
When the code
SET STEP ON is encountered, execution suspends and the VFP Debugger Trace Window (trace window) opens.
Next: VFP Debugger Watch Window
Category VFP Ide Category VFP Debugger
( Topic last updated: 1999.10.06 12:04:36 AM )