This is a message from MicroFocus on possible problems working with MicroFocus COBOL


======= fixing "illegal operation" problem =======

On some machines running Windows 95 or Windows 98 a general protection
fault
occurs with a message:

The program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
  
ANIM2WG caused a general protection fault in module COBLIB.DLW

Thsi problem is due to an incompatibility between Personal COBOL and some
new video device drivers.  Our web site has a patch which eliminates this
problem.  Please go to our support web page and use a web browser to
download it from:

        http://www.merant.com/ads/academic/cat/support/pcw001.htm

click on the link "Download COBLIB.EXE" at the bottom of the page, and
download the COBLIB.EXE file into a temporary folder on your machine. 

Execute the file (using Start -> Run on Windows 95) and it will expand a
COBLIB.DLW file into the same location as the EXE. 

Restart your pc, then copy the COBLIB.DLW file into the Personal COBOL
system folder (usually the c:\pcobwin subdirectory, unless you chose a
different name during setup) replacing the old file with the new file.
After
rebooting the system, the general protection fault error will not occur. 

This fix will be included in the shipped product as soon as possible, but
in
the meantime please share the patch if you know anyone else with the
problem.


==== RTS Load Failure message error 173 ====

IF you get a window titled "Animator V2 COBOL Text Window", which reads
    RTS - Load Failure Error
    Filename : DIRECT
    Error number : 173
    Program Name : ANIM2WG
    etc.
and another larger window behind, with the same title, which reads
    FILE NOT FOUND: COBCLI.LBR
    FILE NOT FOUND: CHECK.LBR
    and five more filenames

THEN the cause is incorrect environment variable settings.
These variables are normally set by Autoexec.bat when the
computer starts, but sometimes the Personal COBOL Setup
program gets the changes wrong.

Here are simple directions to correct the settings, by editing your
Autoexec.bat file:

open Windows Explorer
-- click Start, choose Programs
   click Windows Explorer
     
Find the file C:\AUTOEXEC.BAT
-- if you cannot see Autoexec.bat on C:, you will have to change the
      View options,
   pull down the View menu, choose Options
   click the View tab, and select "Show all Files" 
   uncheck the option "Hide file extensions for known types"
   click OK
     
RIGHT CLICK on Autoexec.bat
Click on Edit; this will use Notepad to open the file for editing.
     
Add the following single new line, at the top of the file: 
CALL C:\PCOBWIN\PCOBENV
     
This assumes you installed Personal COBOL into the default folder
Pcobwin. You must use the name of the actual folder where you installed
it, so if you installed to a folder called COBOL on the D: disk then you
would add a line reading CALL D:\COBOL\PCOBENV 

Save the file and close Notepad.  Reboot your pc.  
Personal COBOL should now work.
     
If these simple instructions do not work, then you need to *check* and 
correct the environment variable settings as described in the following 
longer note.
     
==== RTS Load Failure message error 173 when starting Personal COBOL ====

The cause of this error is that Personal COBOL cannot find parts of
its system.  Environment variables are used to point to the Personal
COBOL system files, and in this case the environment variables are
not pointing to the right place.  This may be because they are simply
not set, or they may be incorrect.  The cure is to correct the 
environment variables.  When they are correct, Personal COBOL will be
able to locate its system files and will start and run properly.

NOTE: Personal COBOL will work only when it is in a folder which has a
name that is supported by MS-DOS. That is, the folder name must not have
more than eight characters, and can only have letters and numbers. If
the installation folder has a name longer than eight characters, or if
it includes spaces, then it should be renamed or Personal COBOL should
be reinstalled. If the folder is renamed, then the name must also be
changed in Autoexec.bat

EXPLANATION
-----------

Environment variables are settings stored in Windows, which act like
pointers for any program which needs them. Usually the environment
variables should be set automatically when your pc starts up. When it
starts, the computer reads the file called Autoexec.bat, and that file
contains the commands to set the environment variables. Sometimes the
commands are not executed as expected, so the Autoexec.bat file needs to
be changed so the environment variables are set correctly.

The cure for RTS Load Failure message error 173 is to check the
environment variable settings (which can only be done at a Command
Prompt), then correct them, which can be done several different ways,
whichever you find easiest. Details of how to do this follow.

Note: the steps are first to check the environment variable settings,
then adjust the settings, reboot and check them again. 

After making a change to Autoexec.bat, you have to restart the computer,
because it only reads Autoexec.bat when it starts. Then, after
restarting, you can check to see if the environment variables are right.
When they are right, Personal COBOL will work. If they are not right,
then change Autoexec.bat again until they are right.

Personal COBOL must have the COBDIR environment variable pointing to the
directory containing the Personal COBOL system files, and must also have
that directory on the PATH environment variable.  There are other
environment variables which are used, but COBDIR and PATH are the
essential ones.

*** In most cases you can fix this by a simple edit to Autoexec.bat.
Move the lines which set the Personal COBOL variables to the top of the
file, and make sure the settings of the variables use MS-DOS-style names
(change the names if needed). Reboot, then check the settings again.***

These are the lines which are needed to set Personal COBOL's
environment:

        PATH=%path%;C:\PCOBWIN
        COBDIR=C:\PCOBWIN
        DSGDIR=C:\PCOBWIN
        COBCPY=C:\PCOBWIN\CLASSLIB
        COBHNF=C:\PCOBWIN
        COBSW=+p3/s14000

Putting these lines at the top of the Autoexec.bat file will set up the
environment for Personal COBOL when the computer is started.

Please *CHECK* the settings both before you change Autoexec, and then
again after you have made the changes and rebooted your computer, to
ensure that COBDIR points to C:\PCOBWIN, and that the PATH also includes
C:\PCOBWIN. You check the settings by opening a Command Prompt, and
typing SET, then pressing Enter -- the system will display the settings
of all the environment variables, so look for COBDIR and PATH.

A Command Prompt is also called a DOS prompt, or a C prompt, and various
other names. You can open it in Windows 95/98 by clicking the Start
button, choosing Programs, then clicking on "MS-DOS Prompt". 

To see the Personal COBOL Readme if you are using Windows 95, click the
Start button, then Programs, then Personal COBOL and you will see the
shortcut to the Personal COBOL Readme. Alternatively, use "My Computer"
to look in the C:\PCOBWIN folder and double-click Readme.Hlp. 

The Personal COBOL for DOS Readme file does not include this topic, so
please read the section below "DOS Environment for Personal COBOL"
for extra information on settings if you have the DOS version. 

 ------------------------------

CHECKING ENVIRONMENT VARIABLE SETTINGS.

The way to check the variable settings is:
 1 - open a MS-DOS Prompt
 2 - type SET and press the Enter key
 3 - look in the list of variables which is displayed, and check the 
     values of COBDIR and of PATH

COBDIR should point to the folder where Personal COBOL is installed:
    COBDIR=c:\pcobwin
If you chose a different folder when you installed, its name should 
be here (not c:\pcobwin), and the name must be an MS-DOS format name.

PATH should include the same folder, along with various other 
directories depending on your pc:
    Path=C:\WINDOWS\system32;C:\WINDOWS;c:\pcobwin;c:\bin\bats;c:\mks
So long as the Personal COBOL folder is included somewhere in the path,
then (if COBDIR is also right) Personal COBOL should work.

Other environment variables are used by Personal COBOL, but PATH and 
COBDIR are the two essentials without which it will not work.

The environment variables that are used by Personal COBOL for Windows 
are:

        PATH=C:\PCOBWIN;
        COBDIR=C:\PCOBWIN
        DSGDIR=C:\PCOBWIN
        COBCPY=C:\PCOBWIN\CLASSLIB
        COBHNF=C:\PCOBWIN
        COBSW=+p3/s14000

This assumes you installed Personal COBOL for Windows to the default
directory C:\PCOBWIN. If you chose a different directory then the
environment variables must point to it.  will be a
list of the other directories your system uses -- it will not be
"". 

The Setup program which installs Personal COBOL may have added these
environment variables to your computer's AUTOEXEC.BAT file. On most pc's
AUTOEXEC is run every time the computer starts.

If AUTOEXEC.BAT is not getting the settings right, you can set the
environment variables by running the PCOBENV.BAT file, which is in your
Personal COBOL system directory (C:\PCOBWIN unless you chose a different
directory during Setup). If you use Windows95 you can run PCOBENV from
your AUTOEXEC file, because Win95 does not start DOS first -- add this
line to your AUTOEXEC.BAT file:

        call C:\PCOBWIN\PCOBENV.BAT

Alternatively you can open a Command Prompt, run Pcobenv at the prompt, 
then start Personal COBOL from the prompt.  This allows manual control 
of the startup process, which can help solve problems.  The steps to do 
this are:
 1 - open a Command Prompt
 2 - set the variables by entering the command:
        c:\pcobwin\pcobenv
        (if your Personal COBOL is in a different folder, then use 
         its location instead of c:\pcobwin)
 3 - start Personal COBOL by entering the command:
        anim2wg

 ------------------------------

A few pc's are not able to set the variables by running PCOBENV.BAT from
AUTOEXEC.BAT. In these cases it is usually best to add the
environment-setting commands directly into the AUTOEXEC.BAT file. Add
these lines to the top of the AUTOEXEC.BAT file:

        set PATH=%PATH%;C:\PCOBWIN;
        set COBDIR=C:\PCOBWIN
        set DSGDIR=C:\PCOBWIN
        set COBCPY=C:\PCOBWIN\CLASSLIB
        set COBHNF=C:\PCOBWIN
        set COBSW=+p3/s14000

Note that if Personal COBOL is not installed in C:\PCOBWIN then the name
of the actual folder where it is installed must be used in these new
lines. Be careful to use the colon and semicolon characters exactly as
shown here.

 ------------------------------

Sometimes AUTOEXEC.BAT is right, but there is not enough space for the
variables. If you get a message saying "Out of environment space" then
you must change CONFIG.SYS.

FIXING "OUT OF ENVIRONMENT SPACE"

Windows (and DOS) set aside a limited area of memory at boot time to
hold environment variables. When the space allocated is full, no more
variables can be set, and a message "Out of Environment Space" is shown.
The space cannot be increased after the pc has booted, but Windows can
be told to allocate more memory at boot time. This is done in the
C:\CONFIG.SYS file. Some Windows 95/98 installations do not have a
Config.sys file, so in these cases it is necessary to create a new one.

Incorrect changes to Config.sys can prevent the computer from working,
so it is very important to make a backup copy of Config.sys before you
change it. (Step-by-step instructions how to backup Config.sys are in
the next section.)

To increase the space allocated for environment variables: 

1 - find the file COMMAND.COM and note its location. Usually it is 
    in the C:\ folder (i.e. the "root" folder). 

To find this file you may have to change the option settings in 
My Computer or Windows Explorer:  
    Pull down the View menu, 
    click Options, 
    then click the View tab. 
    Choose the "Show all Files" button 
    and click OK.  

 2 - Edit the file C:\CONFIG.SYS.  To see this file you may have 
     to change the option settings in My Computer, as for step 1.  
     Some Windows 95/98 installations do not have a Config.sys file, 
     so in these cases it is necessary to create a new one with the 
     editor.  You can use any editor, such as the EDIT editor, or 
     the Windows Notepad.

 3 - Add a line at the very top of Config.sys to invoke Command.com 
     (which you located in step 1) as your shell, 
     with parameters /P/E:2048   
     You must specify the folder where command.com is located on 
     your pc.  E.g. the line might read:  
           shell=C:\MYDOS\COMMAND.COM /P/E:2048
     but it MUST be accurate for your pc -- you must use the location 
     of your Command.com, which is probably different than C:\MYDOS 
     used in this example.  If you enter the wrong location in this 
     line, it will prevent your computer from starting.  Make sure 
     you have a backup copy of Config.sys before you make this change, 
     so you can restore it if the change prevents your pc from starting.

If your computer will not start due to changes you have made to
Config.sys, then you must start it in user-assisted mode. Hold down the
F8 key when you reboot, and select the option of reviewing each startup
command. When Config.sys is processed, skip the line you added. When the
reboot is complete you can fix the problem either by replacing
Config.sys with the unchanged backup, or by correcting the setting for
'shell' .

====== backing up CONFIG.SYS ======

- open a MS-DOS command prompt
  click Start / Programs / MS-DOS Prompt

- change the working directory to the root of the C: drive
  enter these commands, each line followed by the enter key
      C:
      cd \

  the command prompt should now look like this C:\>

- see what copies of CONFIG already exist, enter
      dir config.*

  this will show all files with the root name CONFIG.  
  You may get a list that looks roughly like this
     Directory of C:\

    02/24/97  10:03a                   564 CONFIG.BAK
    02/25/97  11:17a                   579 CONFIG.DOS
    10/29/98  02:37p                   557 CONFIG.SYS
                  3 File(s)          1,636 bytes
                                37,060,608 bytes free      

   (yours will probably be laid out differently)
   
- choose a name for the backup which is different from all names shown.
  E.g. you might choose to use the name CONFIG.SAV, or CONFIG.OLD, etc.

- copy the existing CONFIG.SYS to whatever name you chose, using 
  this command

      copy config.sys config.old

- you can check that the file was copied correctly, by using the 
  DIR command again:

      dir config.*

     Directory of C:\

    02/24/97  10:03a                   564 CONFIG.BAK
    02/25/97  11:17a                   579 CONFIG.DOS
    10/29/98  02:37p                   557 CONFIG.SYS
    10/29/98  02:37p                   557 CONFIG.OLD
                  4 File(s)          2,123 bytes
                                37,060,608 bytes free      

That's it, you now have a backup copy (which you can delete later, 
when you know your changes to increase the environment space are 
working correctly.)

- your can close the MS-DOS prompt by using the command 

      exit

====== end of text on backing up CONFIG.SYS ======

These environment variables should be set before Windows is started,
because variables set in a Windows MS-DOS prompt are only available in
that window, and are not available to Personal COBOL, unless Personal
COBOL is started from the command line of that window.

This is what the Personal COBOL environment variables do:

PATH=C:\PCOBWIN;; tells DOS and Personal COBOL 
                                     where to find its executable files.

COBDIR=C:\PCOBWIN       where Personal COBOL finds its system files

COBSW=+p3/s14000        runtime support switches for optimum stack use 
                        (you can experiment with /s value, e.g. /s12000) 

COBCPY=C:\PCOBWIN\CLASSLIB      tells the compiler where to find 
                                the OO Class Library

DSGDIR=C:\PCOBWIN                       tells PDS where to find its system
files

 ------------------------------

DOS Environment for Personal COBOL

Personal COBOL uses environment variables to tell it where its system
files are located. These variable settings must be correct for Personal
COBOL to work. In most cases the Setup program will arrange the
environment variables for you, but sometimes manual help is needed. If
Personal COBOL gives an error message the first time you choose to
compile a program, check the environment variables.

To check the environment variables, go to a DOS prompt and type SET and
press enter. DOS will list the settings of all its environment
variables. 

Personal COBOL for DOS uses only three environment variables, and the
default installation directory is C:\MFCOBOL, so the details are
slightly different for the DOS version. Please note that Personal COBOL
for DOS does not usually include the file PCOBENV.BAT, and the Readme
file does not include information on the environment variables, because
information is included in the Programmer's Guide (ch.2). The
environment variable settings required for the DOS version, when
installed to the default directory, are:

        PATH=C:\MFCOBOL;
        COBDIR=C:\MFCOBOL
        COBHNF=C:\MFCOBOL

These environment variables can be set using the following commands (in
a batch file of your own, or in autoexec.bat, or entered from the
Command Prompt):

        set PATH=C:\MFCOBOL;%path%
        set COBDIR=C:\MFCOBOL
        set COBHNF=C:\MFCOBOL

==== end of text on RTS Load Failure message error 173 ====