To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
Using Breakpoints

Debugging DataFlex Apps

Lesson 2: Start Debugging

Debugging techniques will be shown by inspecting the code for the ‘Generate’ button that is part of the ‘OrderGenerator.vw’ view. 

  1. Double click on the ‘Generate’ button to open the Code Editor to that object

  2. Clicking in the left margin of the Code Editor places a breakpoint
    • Apply a breakpoint at the line If (bSpecs0k) Begin
  3. Click the Run icon from the top menu bar to run and compile the program
    • The Studio will compile the program if there are code changes, and then run in debug mode
  4. Click on the ‘Generate’ button in the running program
  5. The code shows that the program has stopped where the breakpoint was placed
  6. The ‘Locals’ window at the bottom of the Studio shows all of the local variables and the current method listed
  7. The ‘Globals’ window shows all of the predefined variables from the DataFlex packages. These are rarely used.
  8. The ‘Tables’ window lists all of the currently opened tables in the program
    1. Currently, ‘ordsys’ is the only active table. The is because it is a system table, and system tables always have their one and only row loaded in the global table buffer. 
    2. The remaining tables show as inactive because no rows have been found within them.
  9. The ‘Breakpoints’ table shows the single breakpoint that was added
    1. The icon shows red to indicate that it is enabled. The window also shows which file and line of code the breakpoint was added to, and that no conditions have been added to it.
  10. The ‘Watches’ window is currently empty but is an extremely valuable resource within the debugger because custom watches can be added to Locals and Globals tables and even custom expressions. This allows a developer to only focus on what is important to them while debugging without the clutter of all the other windows.
  11. Tip: To move stacked windows to be next to each other, simply click on the named tab of the window, and drag it to the desired location to pin in as a new Studio pane.
  12. A variable can be dragged from the Code Editor, the ‘Locals’ window or the ‘Tables’ window into the ‘Watches’ window
  13. Alternatively, variables in the different windows can be right clicked, and “Add ‘variable name’ to Watches” selected to have them placed into the ‘Watches’ window
  14. An error message will appear if a variable is added to the ‘Watches’ window that cannot be evaluated