HP 3000 Manuals

Operation [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Operating Guide for the Series 700 and 800

Operation 

Once you have compiled a program for animation, you can invoke Animator.
This section explains:

   *   how to compile your program for animation

   *   how to invoke Animator

   *   where to place various files required by Animator

   *   how the Animator screens are organized

   *   how to operate the display and access the Animator functions.

Preparing for Animation 

Before you can animate a program, you must compile it with the Micro
Focus COBOL compiler.  See Chapter 3 , Compiling for details.  The
command to compile your program for animation is:

cob program-name 

By default, the Micro Focus COBOL system uses the -a cob flag to compile
your source files ready for animation.  See Chapter 2 , COBOL System 
Interface for details.  Before you invoke Animator, set the environment
variable TERM to the appropriate value for your terminal.  To allow
Animator to search for the required source files, you must set up the
$COBPATH environment variable.  See Appendix I , Environment Variables 
for details.

If the system is unable to write to a .idy file, you may receive the
following error:

I-O Error: IDY file (fatal)

You should ensure that sufficient disk space is available, and remove any
LOCK or READ ONLY attributes that your file contains, and recompile your
program.

Invoking Animator 

To invoke Animator, enter the command line: 

anim [switchparams] program-name [directives]

To invoke the base Animator, use the following 
command: 

animbase [switchparams] program-name [directives]

where:

switchparams         is a set of switches.  Each switch must be preceded
                     by a plus sign (+) to turn it on, or a minus sign
                     (-) to turn it off.  Switches may be set in any
                     order.  The last setting of the switch is the one
                     that is accepted.  See Appendix E , Descriptions 
                     of Run-Time Switches for details of the switches
                     available.

program-name         is the name of the file you wish to animate.  If you
                     do not specify an extension, the extension .gnt will
                     be searched for first, followed by .int.  Any .gnt
                     file will be zoomed.  The file-name should be of the
                     format described in the Chapter 3 , Compiling.
                     If you do not specify a path, the current directory
                     is assumed.

directives           is an optional sequence of one or more Animator
                     directives.  Each directive must be separated by at
                     least one space and must not be broken across lines.
                     For details on the directives available, see
                     Appendix F , Directives for Animator. 

If you attempt to run Animator using a Run-Time system built using the
"-m sqfile" option, you will receive undefined results.

Copy File and Information File Location 

You can direct the COBOL compiler to look for COPY-files in a particular
location if they are not found in the same directory as the main source
file.  You do this by setting the environment variable COBCPY. See
Appendix I , Environment Variables for details. 
During animation, a copy file is searched for in the path where it was
found during compilation.  If it is not found there, the directories
specified by the COBCPY environment variable will be searched (see
Chapter 3 , Compiling for details).  For example:

     COBCPY="/usr/group/sharedcopy:/usr/mydir/mcpy"

Animator can be directed to look for its information (.idy) files in a
particular location if they are not found in the same directory as the
program being animated.  To do this, you set the environment variable
COBIDY. 
For example:

     COBIDY=":/usr/lib/cobol/"

Screen Description and Operation 

The Animator screen appears after you have invoked Animator.  The source
code of your program appears on this screen.  The cursor is positioned
under the first executable statement in the Procedure Division, and this
statement is highlighted.  The bottom of the screen displays the
Information Line and the Animator Main menu.

The main menu for Animator is shown in Figure 4-1 .

	       Click here to view figure.
          Figure 4-1.  Main Menu - Animator 

The Animator Main menu contains functions that you select to control the
way your program is executed.  A full description of these functions is
presented later in this chapter.

When you use an option that causes statements to be executed, the cursor
and highlighting follow the execution path, so they are always on the
statement to be executed next.  At other times, the highlighting remains
on the statement that is to be executed next, but you can move the cursor
around the screen to access different places in the source.  The
statement to be executed next, or currently being executed, is always
highlighted.  It is known as the current statement.

The Information Line.   

The Information Line displays the name of your program.  It also shows
the current level (Level=01) of nested PERFORM statements in the program,
and the speed at which you have selected to animate your program.  The
Ins, Caps, Num and Scroll indicators, which appear on the right side of
the information line, are highlighted when Ins, Caps Lock, Num Lock, or
Scroll Lock respectively are reorganized to be active, using the
appropriate Animator keys.  See the section "Default Animator Function
Keys"  later in this chapter for details.

Moving the Cursor and Text During Animation.   

You can use several keys to move the cursor through the displayed code.
You can also change the portion of text displayed on the screen.  These
keys are listed below.  Some of these keys are symbolic key names which
may not be present on your keyboard.  See Appendix N , UNIX Key Usage 
Chart for details on the actual keystrokes required to achieve the
documented function.

Key                  Function 

->                   moves the cursor left one character position

<-                   moves the cursor right one character position

up arrow             moves the cursor up one line; with Scroll Lock on,,
                     moves the text down one line

down arrow           moves the cursor down one line; with Scroll Lock on
                     moves the text up one line

Tab                  moves the cursor to the next tab position to the
                     right; tabs are set every four positions in columns
                     8 through 72

Backtab              moves the cursor to the next tab position to the
                     left

Enter                moves the cursor to column 8 on the next line; with
                     Scroll Lock on,, moves the text up one line

Home                 moves the cursor to column 1 of the current line;
                     pressing Home a second time moves the cursor to
                     column 1 of the top line; pressing Home a third time
                     moves the cursor to the beginning of the file

End                  moves the cursor to the end of the current line;
                     pressing End a second time moves the cursor to the
                     bottom of the screen; pressing End a third time
                     moves the cursor to the end of the file

PgUp                 displays the screen of program text preceding this
                     screen

PgDn                 displays the screen of program text following this
                     screen

Top-of-text          moves immediately to the top of the program
(Ctrl+Home) 

Bottom-of-text       moves immediately to the end of the program
(Ctrl+End) 

Up-ten-screens       moves (10 x source screen size) lines up the program
(Ctrl+PgUp) 

Down-ten-screens     moves (10 x source screen size) lines down the
(Ctrl+PgDn)          program

Entering Text on Menus.   

Several of the Animator menus require you to enter text.  In all cases,
on entry to the menu, the previous contents of the field will be
present.  This can be cleared using F2.  The F2=clear key acts as a
delete-to-end-field, deleting all characters from the current cursor
position to the end of the field.  When entering or editing text, the
keys <-, ->, Home, End and Backspace all operate as normal.  Insert or
overtype mode can also be selected using the Ins key.

Once you have completed a field, pressing the Enter key will confirm your
update.  If you wish to cancel the update, press the Escape key.  Both
keys will cause exit to a higher level menu if appropriate.

Where a selection of fields is presented, the cursor keys may be used to
move up and down the list, and the Enter key will select the item you
want and place it in the input field if appropriate.

Using the Animator Windows.   

Animator places information within windows which you can manipulate.
This facility is not available with the base Animator.

You view your COBOL source code as a backdrop to the windowing system
displaying the monitored data items.  You can fill the screen as required
with the contents of data items.  The system is capable of covering the
entire source code area with data windows.  Simple keystrokes allow the
monitored items to be hidden, reappearing automatically whenever they
change in value.

Viewing Data 

You can view a maximum of 200 characters in COBOL format in one window.
You can scroll through the contents of this window to view other parts of
the data item.  In order to monitor more than 200 characters at one time,
you use multiple windows to monitor the same data item.  You also have
the option of displaying a maximum of 128 bytes of the monitored item in
hexadecimal format.

Note:    Numeric values are viewed as equivalent edited PICTURE strings.

The contents of data items that you can change appear in reverse video in
the monitoring windows.  Keyboard keys and special keystrokes allow
efficient editing of the item's contents.  See the section Key Functions 
for Updating Queried Data Items later in this chapter.

Creating and Adjusting Windows 

The following procedures may be performed:

   *   change the number of characters displayed by defining a new shape
       and size for the window

   *   change the position of the window on the screen

   *   move the window almost entirely off the screen, leaving one
       character displayed for easy access to the window.

Key Functions for Updating Queried Data Items 

The following keys and key combinations have special effects when
updating the contents of data items.  Your keyboard may not have exactly
these keys.  See the Appendix N , UNIX Key Usage Chart for details of
the actual keystrokes required to achieve the documented function.

Key                   

                     Function 

Home                 moves cursor to beginning of window

Top-of-Text          moves cursor to beginning of data item; causes
                     contents of window to change if not currently
                     displaying beginning of item

End                  moves cursor to end of window

Bottom-of-Text       moves cursor to end of data item; causes contents of
                     window to change if not currently displaying end of
                     item

down arrow           moves cursor down one line; if at bottom of window,
                     updates window to show next window of item's
                     contents

up arrow             moves cursor up one line; if at top of window,
                     updates window to show previous window of item's
                     contents 

<-                   moves cursor left one character position; if at
                     beginning of window, shifts data in window one
                     character to the right

->                   moves cursor right one character position; if at end
                     of window shifts data in window one character to the
                     left

F2                   clears contents of data item

Ins                  toggles between insert and replace modes; in insert
                     mode, Ins is highlighted on the information line;
                     cursor changes shape

Del                  deletes character at current cursor position; if
                     insert mode is on, causes all other characters to
                     right of cursor in the window to shift left one
                     position

Backspace            deletes character before cursor position; if insert
                     mode is on, causes all characters to right of cursor
                     in the window to shift left one position 



MPE/iX 5.0 Documentation