Skip to main content

Problem:

Using display statements to track a COBOL program's activity has been pretty routine for as long as there have been programmers using the COBOL programming language. This example illustrates how you can use display statements in a COBOL DLL program.

Resolution:

BUILD WITH RELEASE:     NetExpress 3.1 SP1, 4.0 all04n40.exe

==============

Two Net Express project files, DLLDisplays.APP and DLLDisplays.OLD, are present in the project directory. The DLLDisplays.APP file is a Net Express 4.0 project file. The DLLDisplays.OLD file is a Net Express 3.1, SP1 project file. If you are working with Net Express 3.1 rename the 4.0 project file (DLLDisplays.V40) and change the file extension of the 3.1 project file from "OLD" to "APP".

INTRODUCTION

==========

Using display statements to track a COBOL programs activity has been pretty routine for as long as there have been programmers using the COBOL programming language. This example illustrates how you can use display statements in a COBOL DLL program.

SOURCE FILES:

=========

Program Files           Description

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

Main.cbl                   The main program of a two program set that calls a sub

                                program named "sub". This program uses display

                                statements showing the programs progress.

Sub.cbl                    The second program of a two program set that when

                                called displays a notice that it is terminating.

REQUIREMENTS:

==========

You must open the DLLDisplays project, select Debug Build, click Project (menu) and  Rebuild All (button), then you can Animate the example programs.

You must open the DLLDisplays project, select Release Build, click Project (menu) and  Rebuild All (button), then you can Run the example programs from a Windows or Net Express command prompt.

OPERATION:

========

How does this example program work?

The Release version of this example uses the "COBOL Text Window". This is determined by the "graphical" Build Setting assigned to the .EXE program. The COBOL Run-time provides the text window to support your display statements.

When the application ends you will see a Windows MessageBox with this title and legend:

                     Main.exe - COBOL Text Window

                        Application Completed

                                 OK

You can move the MessageBox aside to reveal all of the content of the COBOL Text Window. You can also control the display of this MessageBox. If you clear the screen to spaces before you stop the program, the Application Completed MessageBox will not be displayed. When you click

the OK button the COBOL Text Window closes and your application ends.

Additional control over the COBOL Text Window is available from the  system menu (Icon in upper left corner of window). There are two buttons in this menu:

     Settings...

     Font Size...

Settings opens a simple dialog that permits you to:

-     save the window size and position on exit;

-     save the font size on exit;

-     disables the termination prompt on exit.

Font Size permits you to select a font and point size (if available) that will determine the legibility and size of your window and text display.

==========================================================

Keywords: demonstration, sample, example, demo, DLLDisplays.zip

demo.ex

demo.ne

Attachments:

DLLDisplays.zip

Old KB# 4002