navigation map

Chapters:
  1: Introduction
  2: Simple example
  3: Invocation
  4: Finer Control
  5: X-Y Plots
  6: Contour Plots
  7: Image Plots
  8: Examples
  9: Gri Commands
  10: Programming
  11: Environment
  12: Emacs Mode
  13: History
  14: Installation
  15: Gri Bugs
  16: Test Suite
  17: Gri in Press
  18: Acknowledgments
  19: License

Indices:
  Concepts
  Commands
  Variables
index.html#Top Programming.html#Programming Gri: Hints for Gri programming Gri: error messages index.html#Top Gri: error messages

10.13: Debugging Gri Programs

Here are some hints for debugging Gri programs:
  • If no data appear on an xy plot, insert `show columns statistics' or `show columns' after the `read columns' command. It may be that you have fixed your axes, and that the axes frame does not include the data.
  • If you get an error message, rerun your Gri program using the `-trace' command-line option, to see which line is causing the problem. This often reveals logic errors (e.g. in (`if' statements). You may also turn tracing on or off at any point in your Gri program by setting the built-in variable `..trace..' to 1 or 0. Many Gri users have the Gri command aliased to be in trace mode by default.
  • If Gri complains of a syntax error, consult the printed manual, one of the online manuals, or the online help facility (see Online Help).
  • Check the version number (printed at startup) to see if a new version of Gri has been installed, and check the manual for known incompatabilities.
  • Sprinkle `show' commands throughout your program, to see what's happening. Even when you are sure your program works, it is a good idea to embed `show' statements so are they executed if the `-debug' flag is set:

    
    if ..debug..
      show "X=" .x. "and label is `\label'"
    end if
    

  • If your `draw' commands don't draw anything, check to see whether you've fooled yourself by enforcing an improper scaling; remove explict scaling (`set x axis ...'), clipping (`set clip'), data selection windows (`set input data window x|y') and missing values (`set missing value'). Another trick is to read only a portion of the data set (`read columns 10 x y') and then print out all the values (`show columns').

If you determine that the bug is in Gri, not in your program, please report the bug, so that other users will not have the same hassle; (see Reporting Bugs).

navigation map