| 4GL Programmer's Guide Empress v8.62 January 2003 (Unix only)
--- | ---

  © 1983, 2003 Empress Software Inc.

  All rights reserved. Reproduction of this document in whole or part, by electronic or any other means, is prohibited without written consent from Empress Software Inc.

  RESTRICTED RIGHTS LEGEND

  Use, duplication, or disclosure by the Government is subject to restrictions as set forth in
  subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at 52.227-7013.

  01/03

  Part #: 001-03-C2-110

  This manual covers an element of the 4GL concepts and components. It also provides suggestions on how to design and write 4GL applications and outlines recommended programming style and sequence.

  ## Table of Contents

  ### CHAPTER 1: Application Components

  | 1.1 | Forms
  | 1.2 | Windows
  | 1.3 | Fields
  | 1.4 | Scripts

  ### CHAPTER 2: Events in the 4GL

  | 2.1 | Application Enter Event
  | 2.2 | Application Exit Event
  | 2.3 | Field Enter Event
  | 2.4 | Field Exit Event
  | 2.5 | Key Event
  | 2.6 | Errors and Interrupts

  ### CHAPTER 3: The Development Environment

  | 3.1 | Tables

  |  | 3.1.1 | Application Table
  |  | 3.1.2 | Windows Table
  |  | 3.1.3 | Fields Table
  |  | 3.1.4 | Domains Table
  |  | 3.1.5 | Keys Table
  |  | 3.1.6 | Subscripts Table
  |  | 3.1.7 | Forms Table
  |  | 3.1.8 | Compile Table
  |  | 3.1.9 | Link Table

  | 3.2 | The Development Application

  |  | 3.2.1 | Application Manager
  |  | 3.2.2 | Application Window
  |  | 3.2.3 | Tables Menu
  |  | 3.2.4 | Window Window

  |  |  | 3.2.4.1 | Key Context List
  |  |  | 3.2.4.2 | Form and Form Instance Names

  |  | 3.2.5 | Field Window

  |  |  | 3.2.5.1 | Application Name
  |  |  | 3.2.5.2 | Window Name
  |  |  | 3.2.5.3 | Field Name and Number
  |  |  | 3.2.5.4 | Data Type
  |  |  | 3.2.5.5 | Mode
  |  |  | 3.2.5.6 | Previous and Next Fields
  |  |  | 3.2.5.7 | Range
  |  |  | 3.2.5.8 | Save Name
  |  |  | 3.2.5.9 | Default
  |  |  | 3.2.5.10 | Scripts
  |  |  | 3.2.5.11 | Functions

  |  | 3.2.6 | Key Window

  |  |  | 3.2.6.1 | Application Name
  |  |  | 3.2.6.2 | Key Context Name
  |  |  | 3.2.6.3 | Key Label
  |  |  | 3.2.6.4 | Exit Script Disable
  |  |  | 3.2.6.5 | Script

  |  | 3.2.7 | Script Window

  |  |  | 3.2.7.1 | Application Name
  |  |  | 3.2.7.2 | Script Name
  |  |  | 3.2.7.3 | Return Type
  |  |  | 3.2.7.4 | Script

  |  | 3.2.8 | Form Window
  |  | 3.2.9 | Domains Window

  |  |  | 3.2.9.1 | Functions
  |  |  | 3.2.9.2 | Using a Domain

  ### CHAPTER 4: Data in Tables

  | 4.1 | Opening and Closing Tables

  |  | 4.1.1 | OPEN Statement
  |  | 4.1.2 | Table
  |  | 4.1.3 | Mode
  |  | 4.1.4 | Table Instances
  |  | 4.1.5 | CLOSE Statement

  | 4.2 | Selecting and Contexts

  |  | 4.2.1 | WHERE Clause
  |  | 4.2.2 | GROUP BY and HAVING Clauses
  |  | 4.2.3 | SORT Clause
  |  | 4.2.4 | COUNT Option and Context Name
  |  | 4.2.5 | Moving through a Context
  |  | 4.2.6 | Removing a Context
  |  | 4.2.7 | Defining a Context

  | 4.3 | Accessing Attributes

  |  | 4.3.1 | Assigning and Retrieving Values

  | 4.4 | Updating Tables

  |  | 4.4.1 | INSERT Statement
  |  | 4.4.2 | UPDATE Statement
  |  | 4.4.3 | DELETE Statement

  ### CHAPTER 5: Data in Windows

  | 5.1 | Designing Forms

  |  | 5.1.1 | Background

  |  |  | 5.1.1.1 | Text
  |  |  | 5.1.1.2 | Video Regions
  |  |  | 5.1.1.3 | Boxes and Lines

  |  | 5.1.2 | Foreground

  |  |  | 5.1.2.1 | Fields
  |  |  | 5.1.2.2 | Field Video Types

  |  | 5.1.3 | Description of Editor Screen
  |  | 5.1.4 | Parameters for Fields
  |  | 5.1.5 | Moving and Changing Fields
  |  | 5.1.6 | Joining Fields
  |  | 5.1.7 | Multi-Fields

  | 5.2 | Window Definition and Use

  |  | 5.2.1 | Window Size and Placement
  |  | 5.2.2 | Boxes
  |  | 5.2.3 | Forms and Form Instances
  |  | 5.2.4 | Key Contexts
  |  | 5.2.5 | Using Windows
  |  | 5.2.6 | Message Windows

  | 5.3 | Field Definition and Use

  |  | 5.3.1 | Field Data Type
  |  | 5.3.2 | Field Mode
  |  | 5.3.3 | Next and Previous Fields
  |  | 5.3.4 | Field Numbers
  |  | 5.3.5 | Range, Default, Saved Name
  |  | 5.3.6 | Enter and Exit Scripts
  |  | 5.3.7 | Field Use
  |  | 5.3.8 | Assigning and Retrieving Values
  |  | 5.3.9 | Current Field Control
  |  | 5.3.10 | Field Characteristic Changes
  |  | 5.3.11 | Default and Saved Values

  | 5.4 | User Editing Functions

  |  | 5.4.1 | Editor Modes
  |  | 5.4.2 | Return Key
  |  | 5.4.3 | Deletions
  |  | 5.4.4 | Moving Around
  |  | 5.4.5 | Help
  |  | 5.4.6 | System Editor

  | 5.5 | Video Attributes and the Terminal Database

  ### CHAPTER 6: Key Contexts

  | 6.1 | The Key Context Stack

  |  | 6.1.1 | Description of the Stack
  |  | 6.1.2 | Pressing a Key

  | 6.2 | Key Labels and the Terminal Database

  |  | 6.2.1 | The Key Label

  | 6.3 | Designing Menus
  | 6.4 | Disable Exit

  ### CHAPTER 7: Subscripts

  | 7.1 | Calling a Subscript
  | 7.2 | Passing Parameters
  | 7.3 | Returning Values

  ### CHAPTER 8: Multi-Fields Record Display

  | 8.1 | Multi-Fields

  |  | 8.1.1 | On the Form
  |  | 8.1.2 | In the Window

  | 8.2 | Definition of Multi-Fields

  |  | 8.2.1 | Context
  |  | 8.2.2 | Window and Fields
  |  | 8.2.3 | Next and Previous Line
  |  | 8.2.4 | Scripts
  |  | 8.2.5 | Field List

  | 8.3 | Using a Multi-Field

  |  | 8.3.1 | Loading the Multi
  |  | 8.3.2 | Moving the Cursor

  ### CHAPTER 9: Linked Applications

  | 9.1 | Linking Applications

  |  | 9.1.1 | Treating Variables
  |  | 9.1.2 | Duplicate and Non-Existent Items

  | 9.2 | Called Applications

  |  | 9.2.1 | Linking Called Applications

  ### CHAPTER 10: Creating Applications: Miscellaneous

  | 10.1 | Flow Control Statements

  |  | 10.1.1 | Function Calls and Returns
  |  | 10.1.2 | Branching Statements
  |  | 10.1.3 | Looping Statements

  | 10.2 | Transactions

  |  | 10.2.1 | Statements

  | 10.3 | Locking

  |  | 10.3.1 | Locking Levels
  |  | 10.3.2 | LOCK Table

  | 10.4 | Error Handling

  |  | 10.4.1 | Errors
  |  | 10.4.2 | Interrupts

  | 10.5 | System Commands

  |  | 10.5.1 | The Operating System
  |  | 10.5.2 | Empress Environments

  | 10.6 | Mouse and Touch Screen Functions

  ### CHAPTER 11: Compiling, Linking, Running, and Executing

  | 11.1 | Compiling and Linking Applications

  |  | 11.1.1 | Compiling
  |  | 11.1.2 | Linking
  |  | 11.1.3 | Errors

  | 11.2 | Running an Application

  | 11.3 | Building an Empress Executable