HP 3000 Manuals

Animating Your Program [ Micro Focus COBOL for UNIX COBOL User Guide ] MPE/iX 5.0 Documentation


Micro Focus COBOL for UNIX COBOL User Guide

Animating Your Program 

The best way of debugging your program is to use Animator.  Animator
shows you both the source code of your programs as they are running and
the effect of each statement as it is executed.  You can control the pace
at which your program runs by setting the speed of execution.  You can
also interrupt execution to examine and change data items, alter the
sequence of execution or enter COBOL statements for immediate execution
before your program continues.

Having compiled your program, myprog, for animation, you now animate it.
Enter:

     anim myprog

As Animator starts, you see the start of your program displayed with the
first executable statement of your program highlighted.  You now have
full control and can step through your program execution, set breakpoints
and run any part of the program at full speed, and view and monitor the
contents of any data items.

To learn how to use Animator, follow the sample session described in your
Getting Started book.  You can use Animator very effectively by knowing
how to use the basic functions: 

       Step

       Perform Step

       Perform Exit

       Breakpoint Set

       Zoom

       View

       Locate

       Query

       Monitor (on the Query menu).

When you are familiar with these and with using Animator, you should
become familiar with the following additional functions: 

       Breakpoint Do

       Do

       Reset Quit

       Split Text

       Breakpoint If

       Environment Threshold

       Backtrack.

Working with Multiple Programs 

You can animate an application consisting of a program calling other
programs by following these rules:

   *   Every program that is to be animated under Animator must be
       compiled for animation as described earlier in this chapter.

   *   When you have tested a program and you no longer want to animate
       it, you can speed up your debugging by generating to native object
       code (.gnt).

   *   When animating, native object code programs always run at full
       speed.  Control returns to Animator only when the native object
       code program calls or returns to a program compiled for animation.

Accessing the Command Line from Your Program 

If your program needs to read its command line, for example using the
syntax ACCEPT...FROM COMMAND-LINE, then you must pass the command line
when you invoke Animator.  You can do this using the END directive.  The
END directive indicates that the Animator command line has finished and
anything following it is the command line for the program.  For example:

     anim myprog end -i:in-file new-file

When myprog does an ACCEPT...FROM COMMAND-LINE operation, the string
returned is:

     -i:in-file new-file

See the chapter Writing Programs for more details of passing a command
line.



MPE/iX 5.0 Documentation