CONTENTS Title Page Copyright Page Preface 1 Introduction to Converting FMS Applications 1.1 What Features Are Available in DECforms? 1.1.1 Device-Independent Programs 1.1.2 Sophisticated Screen Control 1.1.3 Ability to Move Between Active Panels Without Returning to the Program 1.1.4 Beneficial Help Model 1.1.5 Program Subroutine Calls in the Form 1.2 Capabilities and Limitations of the FMS Converter 1.3 Steps in the Conversion Process 2 DECforms Concepts for FMS Users 2.1 The DECforms Application 2.1.1 What's in a Form? 2.1.1.1 Form Data 2.1.1.2 Form Records 2.1.1.3 Layouts 2.1.1.4 Functions 2.1.1.5 Viewports 2.1.1.6 Panels 2.1.1.7 Text Literals 2.1.1.8 Panel Fields 2.1.1.9 Responses 2.1.2 Elements of the Program 2.1.2.1 FORMS$ENABLE Request Call 2.1.2.2 FORMS$SEND Request Call 2.1.2.3 FORMS$RECEIVE Request Call 2.1.2.4 FORMS$TRANSCEIVE Request Call 2.1.2.5 FORMS$CANCEL Request Call 2.1.2.6 FORMS$DISABLE Request Call 2.1.2.7 Escape Routines 2.2 Introduction to the Form Manager 2.2.1 Response to Request Calls 2.2.2 Control of the Display 2.2.3 Control of Operator Input 2.2.4 Data Manipulation 2.3 Introduction to the IFDL 3 Converting Your Form or Form Library 3.1 Preparing Your FMS Form or Form Library for Conversion 3.2 Invoking the FMS Converter 3.3 Merging the Output from Several FMS Forms 3.4 Modifying the Converted IFDL Source File 3.4.1 Renaming Panel Fields and Form Data Items 3.4.2 Examining Form Data Items Created from Named Data 3.4.3 Declaring Form Records 3.4.4 Modifying Help Syntax 3.4.4.1 Conversion of FMS Help Messages 3.4.4.2 Conversion of FMS Help Panels 3.4.4.3 Modifying the USE HELP PANEL Clause Created by the FMS Converter 3.4.4.4 Emulating Pre-Help and Post-Help UARs 3.5 Optimizing the Converted IFDL Source File 3.5.1 Form Data Item Data Types 3.5.2 Form Record Field and Program Record Field Data Types 3.5.3 Reordering Panel Fields 3.5.4 Rewriting Responses That Call UARs 4 Modifying Your Program 4.1 Removing Form Driver Calls 4.1.1 The AFCX Call 4.1.2 The CLEAR_VA and FIX_SCREEN Calls 4.1.3 The DEL and READ Calls 4.1.4 The FCHAN and TCHAN Calls 4.1.5 The LEDON and LEDOF Calls 4.1.6 The RETFO and RETLE Calls 4.1.7 The SCR_LENGTH and SCR_WIDTH Calls 4.1.8 The SSRV and STAT Calls 4.2 Changing Form Driver Calls to DECforms Calls 4.2.1 DECforms Call Parameters 4.2.2 Opening the Form Environment 4.2.3 Sending Data to the Form 4.2.4 Getting Data from the Form 4.2.5 Canceling Requests 4.2.6 Closing the Form Environment 4.3 Moving the Logic for Form Driver Calls to the Form 4.3.1 Altering Field Video Attributes 4.3.2 Assigning Default Values to Fields 4.3.3 Clearing the Screen 4.3.4 Controlling Output to and Input from a Terminal Line 4.3.5 Controlling Supervisor Mode 4.3.6 Defining the Decimal Point as Comma 4.3.7 Defining Keys 4.3.8 Determining Form Context 4.3.9 Displaying Forms 4.3.9.1 Terminal Width Determination 4.3.9.2 Panel Overlays 4.3.9.3 Getting the Effect of the DISP and DISPW Calls 4.3.9.4 Getting the Effect of the CDISP Call 4.3.10 Marking Forms as Undisplayed 4.3.11 Modifying the Keypad Mode 4.3.12 Printing Forms 4.3.13 Processing Field Terminators 4.3.14 Refreshing the Screen 4.3.15 Refreshing a Shared Screen 4.3.16 Returning Data from the Form Workspace 4.3.17 Returning Named Data by Index and Name 4.3.18 Setting the Current Workspace 4.3.19 Signalling the Operator 4.3.20 Trapping Illegal Field Terminators 4.3.21 Waiting for the Operator 4.4 Running and Debugging the Converted DECforms Application 5 Converting the FMS Sample Application 5.1 Preparing to Convert the FMS Sample Application 5.2 Invoking the FMS Converter 5.3 Modifying the Converted IFDL Source File 5.3.1 Modifying Form Data Items 5.3.2 Renaming Panel Fields 5.3.3 Adding Record Declarations 5.3.4 Modifying Help Syntax 5.4 Rewriting the Application Program 5.4.1 Converting the SAMP Program 5.4.1.1 Converting the Working-Storage Section 5.4.1.2 Converting the Procedure Division 5.4.2 Converting FMS Status Checking 5.4.3 Converting the INACCT Subprogram 5.4.4 Converting the FMTCHK Subprogram 5.4.5 Converting the MENU Subprogram 5.4.6 Converting the WRITCH Subprogram 5.4.7 Converting the ONECHK Subprogram 5.4.8 Converting the ENDCHK and PRICHK Subprograms 5.4.9 Writing Escape Routines to Maintain a Balance, Summary Total, and Check Number 5.4.10 Converting the MAKDEP Subprogram 5.4.11 Converting the VUEREG Subprogram 5.4.12 Converting the VUEACT Subprogram 5.5 Compiling, Linking, and Running the Converted Application 6 Creating and Modifying Forms 6.1 Invoking the FDE and the Panel Editor 6.2 Using FMS Form Phase Features in DECforms 6.2.1 Assigning a Panel Name 6.2.2 Associating a Help Panel with Another Panel 6.2.3 Assigning Background Color 6.2.4 Assigning Terminal Width 6.2.5 Assigning a Character Set to the Panel 6.2.6 Creating a Viewport to Control Clearing the Screen 6.2.7 Applying Active Highlight to Fields 6.2.8 Calling Escape Routines to Emulate Pre-Help, Post-Help, and Function Key UARs 6.2.8.1 Getting the Effect of Pre-Help and Post-Help UARs 6.2.8.2 Getting the Effect of an Undefined Function Key UAR 6.2.9 Assigning Default Attributes to All New Fields 6.3 Using FMS Layout Phase Features in DECforms 6.3.1 Creating Panel Fields and Applying Field Defaults 6.3.2 Creating Text Literals 6.3.3 Drawing Points, Lines, Rectangles, and Polylines 6.3.4 Applying Display Attributes to Fields and Literals 6.3.5 Creating Date and Time Fields and Adjacent Fields 6.3.6 Creating Groups 6.4 Using FMS Assign Phase Features in DECforms 6.4.1 Specifying Help for Fields 6.4.2 Assigning Field Attributes and Field Validators 6.4.3 DECforms Field Picture Characters 6.4.4 Emulating Field Completion UARs 6.5 Using FMS Order Phase Features in DECforms 6.6 Using FMS Test Phase Features in DECforms 7 Using Advanced DECforms Features 7.1 Defining Keys 7.1.1 Binding Functions to Keys 7.1.2 Writing Function Responses 7.2 Moving Between Panels 7.3 Providing Help for Operators 7.3.1 Creating Help Messages 7.3.2 Creating Help Panels 7.4 Displaying Arrays 7.4.1 Storing Array Data in the Form 7.4.2 Displaying Data Stored in Form Data Groups 7.4.3 Activating Panel Groups for Input 7.4.4 Passing Group Data Between the Program and Form 7.5 Creating Scrolled Regions 7.5.1 Displaying Scrolled Data 7.5.2 Setting Up the Operator's Control of a Scrolled Region 7.6 Determining What Changed During Operator Input 7.6.1 Tracking Form Data Items 7.6.2 Using Receive Shadow Records 7.7 Using Escape Routines 7.7.1 Writing a Program That Uses Escape Routines 7.7.2 Writing Responses That Call Escape Routines 7.7.3 Linking Applications That Use Escape Routines A Comparison of FMS Form Language Statements and DECforms IFDL Statements B FMS Call Conversion Summary C Comments Created by the FMS Converter EXAMPLES 2-1 Sample IFDL Syntax 3-1 FMS Converter Output for a Single FMS Form 3-2 Merged IFDL Source File with Two Viewports 3-3 Sample Form Record Declarations 3-4 FMS Converter Output from an FMS Help Form 3-5 DECforms Help Panel Declaration 3-6 Numeric Data Passed to DECforms 3-7 Form Record Containing a Numeric Record Field 4-1 FORMS$ENABLE Call 4-2 FORMS$SEND Call 4-3 Form Record and SEND Response for ACCOUNT Record 4-4 FORMS$RECEIVE Call 4-5 RECEIVE Response 4-6 FORMS$CANCEL Call 4-7 FORMS$DISABLE Call 4-8 DISABLE RESPONSE That Clears the Screen 4-9 Altering Video Attributes with HIGHLIGHT WHEN 4-10 Using the RESET Response Step 4-11 Viewport and Panel Declaration for Data Lines 4-12 FORMS$TRANSCEIVE Call That Passes a Prompt to and Gets Input from a Data Line 4-13 Protecting Fields from Operator Entry 4-14 Using DECIMAL POINT IS to Define the Decimal Point 4-15 Declaring Built-In Form Data Items 4-16 Viewport That Emulates the CDISP Call 4-17 Using the REMOVE Response Step to Emulate the NDISP Call 4-18 Keypad Mode Elementary Attributes 4-19 Layout and Viewport for a Shared Screen 4-20 Response That Refreshes an Entire Shared Screen 4-21 FORMS$RECEIVE Call to Return Data from Form Data Items 4-22 RECEIVE Response That Returns Data from Form Data Items 4-23 Declaring Form Data with a Default Value 4-24 Form Record and Request Response for Constant Data 4-25 Activating a Panel 4-26 Signalling an Input Error 6-1 Calling Escape Routines from ENTRY and EXIT Responses 6-2 Calling an Escape Routine from an UNDEFINED FUNCTION Response 6-3 Calling Escape Routines on Field Completion 7-1 Function Declaration for a Built-In Function 7-2 Function Declaration for a Function You Name 7-3 New Definition for the NEXT ITEM Function 7-4 Definition for the CHANGE_EMPLOYEE Function 7-5 Menu Panel with Choice Processing 7-6 Declarations of Help Messages 7-7 Declaring and Using Help Panels 7-8 Declaration of Form Data Groups 7-9 Declaration of Panel Fields to Display a Form Data Item Group 7-10 Declaration of a Form Record That Passes Data to Form Data Groups 7-11 Declaration of a Program Record That Passes Data to Groups 7-12 Declarations of the Elements That Control Array Transfer and Scrolling 7-13 Tracked Form Data Items 7-14 Shadow Record Declaration 7-15 Escape Routine in a COBOL Program 7-16 FORMS$ENABLE for Escape Routines 7-17 CALL Response Step FIGURES 1-1 The Automated Conversion Process 2-1 Comparison of DECforms and FMS Applications 4-1 Default Send Transfer in DECforms 4-2 Default Receive Transfer in DECforms 6-1 FDE Main Menu 6-2 Panel Editor Screen Display 6-3 FDE Choose, Create Panel 6-4 FDE Create Panel 6-5 FDE Color Choice Panel 6-6 Panel Editor Display Attributes Menu 6-7 Panel Editor Field Description Panel 7-1 Appearance of Groups on the Display 7-2 Operation of a Scrolled Region TABLES 2-1 DECforms Requests and Associated Responses 4-1 Correspondence Between FMS and DECforms Calls 4-2 FMS Field Terminators and DECforms Built-In Functions 5-1 Data Items That Can Be Removed from the Sample Program 6-1 Comparison of DECforms Display Attributes and FMS Video Attributes 6-2 Comparison of DECforms Field Attributes and Field Validators and FMS Field Attributes and Validation Attributes 6-3 Comparison of DECforms Picture Characters and FMS Field Validation Characters 7-1 Meaning of Shadow Record Characters A-1 Comparison of VAX FMS and DECforms Language Statements B-1 FMS Call Conversion Summary