This adds the variable SYSIN_NUM_RECS to a list of monitored variables. You can see all watched variables in the Exp (expression) column of the Watch list, alongside their current value. SYSIN_NUM_RECS is currently uninitialized. You can also use the Watch list to overwrite a variable's value.
This introduces a breakpoint at the executable line, indicated by a red circle in the left margin.
. Processing starts, and pauses when it reaches the breakpoint.
twice to execute the next two statements.
Look at the Watch list to see the values of the variables at this point: the SYSPRINT_BUFF variable has changed to ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ12 following the sequence of commands to populate SYSPRINT_BUFF.
When the debugger reaches the END statement, you can see from the final value of SYSIN_NUM_RECS (0004) that the program has processed five records. Go back to line first line in the program containing the string SYSIN_NUM_RECS, right-click the variable name and choose View contents of '[variable name]' to view the variable's current value in a message box. You can get the value of any variable this way, not just those that are watched. For example, highlight find and select the string EOF_SYSIN and view that variable's current value.
When execution of the code has finished, and the program exited, the CodeWatch window closes.
Breakpoints and watches are not saved between debugging sessions, and you will have to set them again the next time you run CodeWatch, if required.