OpenEdge Development: Progress 4GL Reference


Table of ContentsPreviousNextIndex
Preface

This Preface contains the following sections:

Purpose

This book defines the Progress® 4GL. It covers all 4GL statements, functions, phrases, operators, preprocessor directives, special symbols, widgets, handles, attributes, methods, and events.

Audience

This book is intended for programmers who develop applications using Progress and for anyone who needs to read and understand Progress 4GL code.

Organization

This book consists of the following three volumes:

Using this manual

The explanation of each statement, function, and phrase includes:

Some elements and features of the Progress 4GL do not apply to all software platforms—operating systems, user interfaces, and database management systems—that OpenEdge™ supports. The documentation tries to note each such platform restriction either with a platform restriction table, with platform restriction notes, or with both.

Platform Restriction Tables

The following is a sample platform restriction table:

Interfaces
OS
SpeedScript
All
All
Yes

A table similar to this appears in each entry of Volumes I and II, and in each entry of the Handle Reference in Volume III.

The first column mentions any restrictions based on interface. Interfaces are graphical and character. For example, a 4GL element might be limited to graphical interfaces only, or to character interfaces only. The preceding table describes a 4GL element not restricted to any particular interface.

The second column mentions any restrictions based on operating system. For example, a 4GL element might be restricted to UNIX only, or to Windows only. The preceding table describes a 4GL element not restricted to any particular operating system.

The third column mentions if the 4GL element applies to SpeedScript. Some 4GL elements do not. The preceding table describes a 4GL element that does.

Platform Restriction Notes

A reference entry might contain one or more platform restriction notes—perhaps in addition to a platform restriction table. The platform restriction notes that appear in the documentation include the following:

For a complete list of the software platforms that OpenEdge supports, see the OpenEdge Getting Started: Installation and Configuration for UNIX or the OpenEdge Getting Started: Installation and Configuration for Windows.

Typographical conventions

This manual uses the following typographical conventions:

Convention
Description
Bold
Bold typeface indicates commands or characters the user types, or the names of user interface elements.
Italic
Italic typeface indicates the title of a document, provides emphasis, or signifies new terms.
SMALL, BOLD CAPITAL LETTERS
Small, bold capital letters indicate OpenEdge™ key functions and generic keyboard keys; for example, GET and CTRL.
KEY1-KEY2
A hyphen between key names indicates a simultaneous key sequence: you press and hold down the first key while pressing the second key. For example, CTRL-X.
KEY1 KEY2
A space between key names indicates a sequential key sequence: you press and release the first key, then press another key. For example, ESCAPE H.
Syntax:
Fixed width
A fixed-width font is used in syntax statements, code examples, and for system output and filenames.
Fixed-width italics
Fixed-width italics indicate variables in syntax statements.
Fixed-width bold
Fixed-width bold indicates variables with special emphasis.
UPPERCASE fixed width
Uppercase words are Progress® 4GL language keywords. Although these always are shown in uppercase, you can type them in either uppercase or lowercase in a procedure.
 
This icon (three arrows) introduces a multi-step procedure.
 
This icon (one arrow) introduces a single-step procedure.
Period (.)
or
colon (:)
All statements except DO, FOR, FUNCTION, PROCEDURE, and REPEAT end with a period. DO, FOR, FUNCTION, PROCEDURE, and REPEAT statements can end with either a period or a colon.
[ ]
Large brackets indicate the items within them are optional.
[ ]
Small brackets are part of the Progress 4GL language.
{ }
Large braces indicate the items within them are required. They are used to simplify complex syntax diagrams.
{ }
Small braces are part of the Progress 4GL language. For example, a called external procedure must use braces when referencing arguments passed by a calling procedure.
|
A vertical bar indicates a choice.
...
Ellipses indicate repetition: you can choose one or more of the preceding items.

Examples of syntax descriptions

In this example, ACCUM is a keyword, and aggregate and expression are variables:

Syntax
ACCUM aggregate expression

FOR is one of the statements that can end with either a period or a colon, as in this example:

FOR EACH Customer:
  DISPLAY Name.
END.

In this example, STREAM stream, UNLESS-HIDDEN, and NO-ERROR are optional:

Syntax
DISPLAY [ STREAM stream ] [ UNLESS-HIDDEN ] [ NO-ERROR ]

In this example, the outer (small) brackets are part of the language, and the inner (large) brackets denote an optional item:

Syntax
INITIAL [ constant [ , constant ] ]

A called external procedure must use braces when referencing compile-time arguments passed by a calling procedure, as shown in this example:

Syntax
{ &argument-name }

In this example, EACH, FIRST, and LAST are optional, but you can choose only one of them:

Syntax
PRESELECT [ EACH | FIRST | LAST ] record-phrase

In this example, you must include two expressions, and optionally you can include more. Multiple expressions are separated by commas:

Syntax
MAXIMUM ( expression , expression [ , expression ] ... )

In this example, you must specify MESSAGE and at least one expression or SKIP [ (n) ], and any number of additional expression or SKIP [ ( n ) ] is allowed:

Syntax
MESSAGE { expression | SKIP [ ( n ) ] } ...

In this example, you must specify {include-file, then optionally any number of argument or &argument-name = "argument-value", and then terminate with }:

Syntax
{ include-file
    [ argument | &argument-name = "argument-value" ] ... }

Long syntax descriptions split across lines

Some syntax descriptions are too long to fit on one line. When syntax descriptions are split across multiple lines, groups of optional and groups of required items are kept together in the required order.

In this example, WITH is followed by six optional items:

Syntax
WITH [ ACCUM max-length ] [ expression DOWN ]
  [ CENTERED ] [ n COLUMNS ] [ SIDE-LABELS ]
  [ STREAM-IO ]

Complex syntax descriptions with both required and optional elements

Some syntax descriptions are too complex to distinguish required and optional elements by bracketing only the optional elements. For such syntax, the descriptions include both braces (for required elements) and brackets (for optional elements).

In this example, ASSIGN requires either one or more field entries or one record. Options available with field or record are grouped with braces and brackets:

Syntax
ASSIGN   { [ FRAME frame ] { field [ = expression ] }
            [ WHEN expression ] } ...
       | { record [ EXCEPT field ... ] }

Example procedures

This manual provides numerous example procedures that illustrate syntax and concepts. Examples use the following conventions:

Accessing files in procedure libraries

Documentation examples are stored in a procedure library, prodoc.pl , in the src directory where OpenEdge™ is installed.

You must create all subdirectories required by a library before trying to extract files from the library. You can see what directories and subdirectories a library needs by using the PROLIB -list command to view the contents of the library. See OpenEdge Deployment: Managing 4GL Applications for more details on the PROLIB utility.

Creating a listing of the procedure libraries

Creating a listing of the source files from a procedure library involves running PROENV to set up your OpenEdge environment, and running PROLIB.

To create a listing of the source files from a procedure library:
  1. From the Control Panel or the Progress Program Group, double-click the Proenv icon.
  2. The Proenv window appears, with the proenv prompt.
  3. Running Proenv sets the DLC environment variable to the directory where you installed OpenEdge (by default, C:\Program Files\Progress). Proenv also adds the DLC environment variable to your PATH environment variable and adds the bin directory (PATH=%DLC%;%DLC%\bin;%PATH%).
  4. At the proenv prompt, enter the following command to create the prodoc.txt text file, which contains the file listing for the prodoc.pl library:
  5. PROLIB %DLC%\src\prodoc.pl -list > prodoc.txt

Extracting source files from procedure libraries (Windows)

Extracting source files from a procedure library involves running PROENV to set up your OpenEdge environment, creating the directory structure for the files you want to extract, and running PROLIB.

To extract source files from procedure libraries:
  1. From the Control Panel or the Progress Program Group, double-click the Proenv icon.
  2. The Proenv window appears, with the proenv prompt.
  3. At the proenv prompt, enter the following command to create the prodoc directory in your OpenEdge working directory (by default, C:\OpenEdge\Wrk):
  4. MKDIR prodoc

  5. Create the langref directory under prodoc:
  6. MKDIR prodoc\langref

  7. To extract all examples in a procedure library directory, run the PROLIB utility. Note you must use double quotes because “Program Files” contains an embedded space:
  8. PROLIB "%DLC%\src\prodoc.pl" -extract prodoc/langref/*.*

    PROLIB extracts all examples into prodoc\langref.
    To extract one example, run PROLIB and specify the file that you want to extract as it is stored in the procedure library:

    PROLIB "%DLC%\src\prodoc.pl" -extract prodoc/langref/r-syshlpchm.p

    PROLIB extracts r-syshlpchm.p into prodoc\langref.
Extracting source files from procedure libraries (UNIX)
To extract source files from procedure libraries:
  1. Run the PROENV utility:
  2. install-dir/dlc/bin/proenv

    Running proenv sets the DLC environment variable to the directory where you installed OpenEdge (by default, /usr/dlc). The proenv utility also adds the bin directory under the DLC environment variable to your PATH environment variable (PATH=$DLC/bin:$PATH).
  3. At the proenv prompt, create the prodoc directory in your OpenEdge working directory:
  4. mkdir prodoc

  5. Create the handbook directory under prodoc:
  6. mkdir prodoc/handbook

  7. To extract all examples in a procedure library directory, run the PROLIB utility:
  8. prolib $DLC/src/prodoc.pl -extract prodoc/interfaces/*.*

    PROLIB extracts all examples into prodoc/interfaces.
    To extract one source file (i-ddeex1.p) from a procedure library (prodoc.pl), run PROLIB and specify the file you want to extract as it is stored in the procedure library:

    prolib $DLC/src/prodoc.pl -extract prodoc/interfaces/i-ddeex1.p

    PROLIB extracts i-ddeex1.p into prodoc/interfaces.

OpenEdge messages

OpenEdge displays several types of messages to inform you of routine and unusual occurrences:

After displaying a message, OpenEdge proceeds in one of several ways:

OpenEdge messages end with a message number in parentheses. In this example, the message number is 200:

** Unknown table name table. (200)

If you encounter an error that terminates OpenEdge, note the message number before restarting.

Obtaining more information about OpenEdge messages

On Windows platforms, use OpenEdge online help to obtain more information about OpenEdge messages. Many OpenEdge tools include the following Help menu options to provide information about messages:

On UNIX platforms, use the Progress pro command to start a single-user mode character OpenEdge client session and view a brief description of a message by providing its number.

To use the pro command to obtain a message description by message number:
  1. Start the Progress Procedure Editor:
  2. install-dir/dlc/bin/pro

  3. Press F3 to access the menu bar, then choose Help Messages.
  4. Type the message number and press ENTER. Details about that message number appear.
  5. Press F4 to close the message, press F3 to access the Progress Procedure Editor menu, and choose File Exit.

Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095
Table of ContentsPreviousNextIndex