VAX RALLY ADL User's Guide

*HyperReader

  CONTENTS

  Title Page

  Copyright Page

  Preface

  1      Introduction

  1.1     Features of ADL

  1.2     Creating ADL Procedures
    1.2.1      Using the RALLY Editor
    1.2.2      Using the VAX Language-Sensitive Editor (LSE)

  1.3     Editing ADL Procedures

  1.4     Compiling ADL Procedures

  1.5     Invoking ADL Procedures

  1.6     Renaming, Deleting, and Copying ADL Procedures

  1.7     Printing ADL Procedures

  2      Elements of ADL

  2.1     Syntax Rules

  2.2     Data Types
    2.2.1      The NUMBER Data Type
      2.2.1.1      Specifying the Attributes of Numbers
      2.2.1.2      Setting Number Formats in the Definition System
    2.2.2      The CHAR Data Type
    2.2.3      The DATE Data Type

  2.3     Variables
    2.3.1      Naming and Declaring Variables
    2.3.2      Scope of ADL Variables
    2.3.3      Global Variables
    2.3.4      Form/Report Fields
    2.3.5      Variables Exported from Other ADL Procedures
    2.3.6      Data Source Definition Fields
    2.3.7      Variables Declared in the Current ADL Procedure-Local Variables
    2.3.8      Parameters
    2.3.9      Constants

  2.4     Functions

  2.5     Operators
    2.5.1      Precedence of Operators
    2.5.2      Arithmetic Operators
    2.5.3      Concatenation Operator
    2.5.4      Relational Operators
    2.5.5      Logical Operators

  2.6     Expressions

  2.7     Statements
    2.7.1      Assignment Statements
    2.7.2      Compound Statements
    2.7.3      Conditional Statements
    2.7.4      Repetitive Statements
    2.7.5      RETURN Statements
    2.7.6      Call Statements
    2.7.7      Procedural Statements

  2.8     Writing ADL Procedures
    2.8.1      Procedure Headings
    2.8.2      Defining Constants
    2.8.3      Declaring Variables
    2.8.4      Procedure Body

  3      Using ADL Procedures

  3.1     Using Single ADL Procedures
    3.1.1      Computing Values for Form/Report Fields
    3.1.2      Validating Form/Report Fields
    3.1.3      Providing Users with Context-Sensitive Information
    3.1.4      Limiting Reports to a Subset of Available Data

  3.2     Passing Values to ADL Procedures
    3.2.1      Using Single ADL Procedures
    3.2.2      Invoking One ADL Procedure with Another
    3.2.3      Invoking ADL Procedures with Parameter Packets

  3.3     Controlling Action Stacks and Application Flow
    3.3.1      Invoking Actions Based on User Input
      3.3.1.1      Checking User Response
      3.3.1.2      Controlling Application Flow
    3.3.2      Generating Values for Use Throughout a Single Task
      3.3.2.1      Running the Application with a Single Task
      3.3.2.2      Running the Application with Several Tasks
    3.3.3      Calling External Program Links to Perform Calculations

  4      ADL Data Manipulation Language

  4.1     Uses of DML

  4.2     RALLY Transaction Control

  4.3     ADL Transaction Control

  4.4     DML Procedures
    4.4.1      DML Status Codes
    4.4.2      DML Error Handling

  4.5     Reading from Data Sources
    4.5.1      Checking for Records in DSDs
    4.5.2      Restricting DSD Record Streams

  4.6     Writing to Data Sources
    4.6.1      Committing Data to Data Sources
    4.6.2      Generating Unique ID Numbers

  4.7     Deleting Records from Data Sources

  4.8     Loading and Unloading Data Between Data Sources

  4.9     Using DML with Different Data Sources
    4.9.1      Using Rdb/VMS Databases
      4.9.1.1      Rdb/VMS Read/Write Transactions
      4.9.1.2      Rdb/VMS Read-Only Transactions
    4.9.2      Using FIX Files
    4.9.3      Using RMS Files
    4.9.4      Using DATATRIEVE Domains

  4.10    Batch Processing

  5      Functions

  5.1     Using Functions

  5.2     Using Expressions as Function Arguments

  5.3     Function Types

  5.4     Character Manipulation Functions
    5.4.1      LENGTH
    5.4.2      REVERSE_STRING
    5.4.3      SEARCH
    5.4.4      SUBSTR
    5.4.5      UPCASE

  5.5     Date and Number Manipulation Functions
    5.5.1      ROUND for Numbers
    5.5.2      ROUND for Dates
    5.5.3      TRUNC for Numbers
    5.5.4      TRUNC for Dates

  5.6     Date Arithmetic Functions
    5.6.1      ADD_MONTHS
    5.6.2      LAST_DAY
    5.6.3      MONTHS_BETWEEN
    5.6.4      NEXT_DAY

  5.7     Data Type Conversion Functions
    5.7.1      TO_CHAR for Numbers
    5.7.2      TO_CHAR for Dates
    5.7.3      TO_DATE
    5.7.4      TO_NUMBER

  5.8     Command Functions
    5.8.1      GET_CMD
    5.8.2      GET_MODE
    5.8.3      IS_CURRENT_FIELD
    5.8.4      TRANSLATE_LOGICAL

  6      Built-In Procedures

  6.1     Invoking Built-In ADL Procedures

  6.2     Procedure Types

  6.3     Controlling Application Flow
    6.3.1      CALL_CMD
    6.3.2      EXECUTE_CMD
    6.3.3      SET_CACHE_SIZE
    6.3.4      SET_CURRENT_FIELD
    6.3.5      SET_FAILURE
    6.3.6      SET_SUCCESS

  6.4     Providing Feedback to Users and Definers
    6.4.1      DEBUG_LOG
    6.4.2      ERROR
    6.4.3      FORCE_OUTPUT
    6.4.4      HELP
    6.4.5      SET_NOTRACE
    6.4.6      SET_TRACE

  6.5     Resetting a Variable to Null: MAKE_NULL

  6.6     Using Logical Names
    6.6.1      DEFINE_LOGICAL
    6.6.2      DELETE_LOGICAL

  6.7     Data Manipulation Language
    6.7.1      DB_CLOSE
    6.7.2      DB_COMMIT
    6.7.3      DB_DELETE
    6.7.4      DB_GET_FIRST
    6.7.5      DB_GET_NEXT
    6.7.6      DB_INSERT
    6.7.7      DB_OPEN
    6.7.8      DB_QUERY
    6.7.9      DB_RESET
    6.7.10     DB_ROLLBACK
    6.7.11     DB_UPDATE

  A   ADL Reserved Words

  B   Symbols for Date Formats, Rounding Masks, and Truncation Masks

  C   Common DML Status Codes

  EXAMPLES

  2-1        The COMPUTE_INVOICE_ADL Procedure

  3-1        The COMPUTE_TRIANGLE_ADL Procedure

  4-1        The GET_ADDRESS_ADL Procedure

  4-2        The FORM_SET_UP_ADL Procedure

  4-3        The GET_ADDRESS2_ADL Procedure

  4-4        The GET_NUMBER_ADL Procedure

  4-5        The DELETE_RECORDS_ADL Procedure

  4-6        The MOVING_DATA_ADL Procedure

  FIGURES

  1-1        ADL List of Values

  1-2        ADL LSE Template Initial Placeholder

  1-3        Expansion of %{ADL-procedure}% Placeholder

  1-4        Template for a Simple ADL Procedure

  1-5        The square_it_adl Procedure

  TABLES

  2-1        Sample Date Formats

  2-2        ADL Functions

  2-3        ADL Operators

  2-4        Precedence of Operators in ADL

  2-5        ADL Procedures

  4-1        DML Procedures

  5-1        ADL Functions

  6-1        ADL Procedures

  B-1        Symbols for Date Formats

  B-2        Date-Rounding Masks

  B-3        Date Truncation Masks

  C-1        Value and Meaning of Common DML Status Codes