CONTENTS Title Page Copyright Page Preface 1 Data Types 1.1 Predefined and User-Defined Data Types 1.2 Nesting Arrays and Records 1.3 String Types 1.4 Nonstatic types 1.4.1 Schema Families and Type Compatibility 1.4.2 Discriminating Schema Types at Run Time 1.5 Data-Type Examples 2 Routines 2.1 Value and Variable Parameters 2.1.1 Parameters of Schema Types 2.2 Static and Automatic Variable Allocation 2.3 Structured Function-Return Values 2.4 Recursion 2.5 Routine Examples 3 Separate Compilation 3.1 The ENVIRONMENT, HIDDEN, and INHERIT Attributes 3.2 Interfaces and Implementations 3.3 Data Models 3.4 Separate-Compilation Examples 4 Program Optimization and Efficiency 4.1 Compiler Optimizations 4.1.1 Compile-Time Evaluation of Constants 4.1.2 Elimination of Common Subexpressions 4.1.3 Elimination of Unreachable Code 4.1.4 Code Hoisting from Structured Statements 4.1.5 Inline Code Expansion for Predeclared Functions 4.1.6 Inline Code Expansion for User-Declared Routines 4.1.7 Operation Rearrangement 4.1.8 Partial Evaluation of Logical Expressions 4.1.9 Value Propagation 4.1.10 Alignment of Compiler-Generated Labels 4.1.11 Error Reduction Through Optimization 4.2 Programming Considerations 4.3 Optimization Considerations 4.3.1 Subexpression Evaluation 4.3.2 Lowest Negative Integer 4.3.3 Pointer References 4.3.4 Variant Records 4.3.5 Type Cast Operations 4.3.6 Effects of Optimization on Debugging 5 Programming on VMS Systems 5.1 Using Attributes 5.2 Using Item Lists 5.3 Using Foreign Mechanism Specifiers on Actual Parameters 5.4 RMS Examples 5.5 RMS and RTL Examples 5.6 Condition Handler Examples 5.7 System Services Examples 5.8 DECwindows Example VAX Pascal Glossary EXAMPLES 1-1 Tic Tac Toe Using a Multidimensional Array 1-2 Discriminating Schema Types with Function Calls 1-3 Building and Accessing a Binary Tree 2-1 Passing Schema Parameters 2-2 Recursive Function in a Binary Tree Program 2-3 Using Recursion to Generate Burger Orders 2-4 Indexing, Dereferencing, and Selecting Function Results 3-1 An Interface Module for Graphics Objects and Routines 3-2 An Implementation Module for Graphics Objects and Routines 3-3 A Graphics Main Program 5-1 Calling the RMS Routine SYS$SETDDIR 5-2 Using the RMS Record File Address (RFA) 5-3 FDL Code that Creates an ISAM File With Varying-Length Records 5-4 Writing to an ISAM File with Varying-Length Records 5-5 Reading from an ISAM File with Varying-Length Records 5-6 Using STATUS and PAS$RAB to Obtain the Status of I/O Operations 5-7 Using Random Access on a Relative File 5-8 Keyed and Sequential Access to Indexed Files 5-9 Using LIB$FIND_FILE to Process a Wildcard File Name 5-10 Using a Condition Handler 5-11 Using Asynchronous System Traps (ASTs) 5-12 Using the SYS$QIOW Routine 5-13 Mapping Global Sections (GLOBAL1.PAS) 5-14 Mapping Global Sections (GLOBAL2.PAS) 5-15 File Sharing from Several Processes 5-16 SYS$DCLEXH and Condition Handlers 5-17 Using SMG Routines 5-18 Using SYS$QIO Routines 5-19 Adjusting the Working Set Size Using SYS$ADJWSL 5-20 Accessing a System HELP Library 5-21 Using SYS$ASCTIM and SYS$GETTIM 5-22 Using SYS$CHECK_ACCESS 5-23 Using SYS$DEVICE_SCAN 5-24 Using SYS$FAO 5-25 Using SYS$GETDVI 5-26 Using SYS$GETJPIW 5-27 Using SYS$GETQUI 5-28 Using SYS$GETSYI 5-29 Using SYS$GETUAI 5-30 Using SYS$PROCESS_SCAN 5-31 Using SYS$PUTMSG 5-32 Using SYS$SNDJBC 5-33 DECwindows Programming FIGURES 1-1 Multidimensional Array as a Tic Tac Toe Board 1-2 Schema Array Types and Linked Lists 2-1 Value and Variable Parameters 2-2 Static and Automatic Variable Allocation 2-3 Using Recursive Routine Calls 2-4 Lifetime of Variables During Recursive Routine Calls 3-1 Cascading Inheritance of Environment Files 3-2 Inheritance Path of an Interface, an Implementation, and a Program 3-3 Cascading Using the Interface and Implementation Design TABLES 1 Conventions Used in This Manual