Table of Contents
top
contents
index
framed top
this page unframed
TableOfContents
MAINSAIL Language Manual
1. Introduction
1.1. Version
1.2. The History of MAINSAIL and XIDAK
1.3. The Design of MAINSAIL
1.4. Terminology and Symbols
1.5. Conventions Used in This Document
1.5.1. User Interaction
1.5.2. Syntax Descriptions
1.5.3. Temporary Features
Tables for Chapter 1: Introduction
1–1. Data Type Abbreviations
2. Basic Language Concepts
2.1. Character Set
2.2. Comments
2.3. Identifiers
2.4. Use of Semicolons and Formatters
2.5. Compiletime Evaluation
2.6. Storage Units and Character Units
2.7. Type Codes
2.8. Garbage Collections and Memory Management
2.8.1. How the MAINSAIL Garbage Collector Determines Whether Data Are Accessible
2.9.
cmdFile
and
logFile
Tables for Chapter 2: Basic Language Concepts
2–1. MAINSAIL Minimum Character Set
2–2. Character-Set-Independent System Procedures
2–5. Type Codes
Examples for Chapter 2: Basic Language Concepts
2–3. Legal Identifiers
2–4. Illegal Identifiers
3. Data Types
3.1. Overflow and Underflow
3.1.1. How to Write
(
LONG
)
INTEGER
Addition and Multiplication Routines That Do Not Overflow
3.2.
BOOLEAN
3.3.
INTEGER
and
LONG
INTEGER
3.4.
REAL
and
LONG
REAL
3.5.
BITS
and
LONG
BITS
3.6.
STRING
3.6.1. Low-Level
STRING
Manipulation
3.6.2.
STRING
Constants and Garbage Collection
3.7.
POINTER
3.8.
$PROCVAR
3.9.
ADDRESS
3.10.
CHARADR
3.11. Conversion Procedures
3.12. Explicit Data Sizing
3.12.1. Allowed Data Types and Sizes for Explicit Sizing
3.12.2. Assignment Compatibility
3.12.3. Where Explicitly Sized Data Types May Occur
3.12.4. Explicitly Sized Data Types and
GENERIC
Procedures
4. Expressions
4.1. Constants
4.2. Variables
4.3.
PROCEDURE
Expression
4.4. Substrings
4.4.1.
INF
4.5.
IF
Expression
4.5.1. Operand Types and Result Type of an
IF
Expression
4.5.2.
IF
Expressions Passed to
$REFERENCE
Parameters
4.6. Assignment Expression
4.7. Compiletime Pseudoprocedures
4.8. Operators and Operations
4.8.1. Why
DIV
and
MOD
Are Undefined for Negative Arguments
4.8.2.
STRING
Comparison
4.8.3. Bitwise Operations
4.8.4. Comparison Chains
4.8.5. Operator Precedence
4.8.5.1. Precedence of the Assignment Operator
4.8.6. Dotted Operators
4.8.7. Operators and Garbage Collection
4.9. Assignment Compatibility
Tables for Chapter 4: Expressions
4–1. Unary Operations
4–2. Binary Operations
Figures for Chapter 4: Expressions
4–3. Precedence of the Assignment Operator in Expressions and Statements
5. Statements
5.1. Assignment Statement
5.2. Expression Statement
5.3.
PROCEDURE
Statement
5.4.
RETURN
Statement
5.5.
BEGIN
Statement
5.5.1. Special Names for Named
BEGIN
Statements
5.6.
IF
Statement
5.7.
CASE
Statement
5.8. Iterative Statement
5.9.
DONE
Statement
5.10.
CONTINUE
Statement
5.11. Empty Statement
5.12. Parenthesized Statements
Tables for Chapter 5: Statements
5–3. Equivalent Forms of Iterative Statement
Figures for Chapter 5: Statements
5–2. Choice of a Selector Is Affected by Ordering of Selectors
Examples for Chapter 5: Statements
5–1. Sample CASE Statement
5–4. Iterative Statement with a CONTINUE Statement
6. Declarations
6.1. Scope of Identifiers
6.2. Simple Variable Declarations
6.3. Qualifiers
6.4.
OWN
Qualifier
6.5.
$SHARED
Qualifier
Figures for Chapter 6: Declarations
6–1. Where Declarations May Occur
7.
PROCEDURE
s
7.1.
PROCEDURE
Declarations
7.2.
PROCEDURE
Calls
7.3. Typed and Untyped
PROCEDURE
s
7.4. Parameters to
PROCEDURE
s
7.5. Parameter Qualifiers
7.5.1.
USES
7.5.2.
PRODUCES
7.5.3.
MODIFIES
7.5.4.
$REFERENCE
7.5.4.1. Classification of
$REFERENCE
Inplace Record Parameters
7.5.4.2. The Null
$REFERENCE
7.5.4.3. Untyped
$REFERENCE
7.5.4.4. Type Compatibility for
$REFERENCE
Parameters
7.5.4.5.
$ref
7.5.4.6. Efficiency of
$REFERENCE
Parameters
7.5.5.
OPTIONAL
7.5.6.
REPEATABLE
7.6. User-Declared
CLASS
Parameters
7.7. Order of Argument Evaluation
7.8. Inplace Record Parameters
7.9. Dynamic
ARRAY
Parameters
7.10. Inplace
ARRAY
Parameters
7.11.
PROCEDURE
Qualifiers
7.12. Recursion
7.13.
FORWARD
PROCEDURE
s
7.13.1.
FORWARD
for Mutual Recursion
7.13.2.
FORWARD
for Source Library Declarations
7.14.
INLINE
PROCEDURE
s
7.15. The
COMPILETIME
PROCEDURE
Qualifier
7.15.1.
SPECIAL
and
$BUILTIN
Compiletime System
PROCEDURE
s
7.15.2. Other System Compiletime
PROCEDURE
s and User Compiletime
PROCEDURE
s
7.15.2.1. How User-Declared Compiletime
PROCEDURE
s Are Handled
7.16.
GENERIC
PROCEDURE
s
7.16.1. Sample
GENERIC
System
PROCEDURE
7.16.2.
GENERIC
PROCEDURE
Instance Selection Algorithm
7.16.3.
GENERIC
PROCEDURE
Selection and
LONG
ARRAY
s
7.16.4.
GENERIC
PROCEDURE
Selection and
STRICTCLASSES
7.16.5.
GENERIC
PROCEDURE
Selection Is Not Based on Return Types
7.16.6.
GENERIC
PROCEDURE
s and Explicit Sizes for Parameter Data Types
7.16.7.
GENERIC
PROCEDURE
Extension
7.17. Stack Overflow
Figures for Chapter 7:
PROCEDURE
s
7–1. Format of a PROCEDURE Declaration
Examples for Chapter 7:
PROCEDURE
s
7–2. A Parameter May Be Used Like Any Other Local Variable
7–3. PRODUCES Parameters Are Not Automatically Initialized
7–4. A FORWARD PROCEDURE
8.
PROCEDURE
Variables
8.1. Declaration
8.2. Zero
8.3. Assignment Compatibility
8.3.1. Safe and Unsafe Assignment of
$PROCVAR
s
8.3.2. Examples of Safe and Legal
$PROCVAR
Assignments
8.4. Operations
8.4.1.
$PROCVAR
-Valued
PROCEDURE
s
8.5.
$PROC
8.6. Initialization
8.7.
$newProcvar
8.8.
$PROCVAR
Example
9.
CLASS
es and
POINTER
s
9.1. Classified
POINTER
s and
ADDRESS
es
9.1.1. Forward
CLASS
es
9.1.2. Classified
ADDRESS
es
9.2. Unclassified
POINTER
s and
ADDRESS
es
9.2.1. Use of Unclassified
POINTER
s Requires Caution
9.3. Classification of Inplace Records
9.4. Accessing Fields of Records, Data Sections, and Storage Templates
9.5. Explicit
CLASS
es
9.5.1.
POINTER
s and
ADDRESS
es with Explicit
CLASS
es
9.5.1.1. Use of Explicit
CLASS
es in
POINTER
or
ADDRESS
Field Variables
9.5.1.2. Use of Explicit
CLASS
es for
POINTER
s and
ADDRESS
es outside Field Variables
9.5.2. Inplace Records with Explicit
CLASS
es
9.6. Prefix
CLASS
es
9.6.1. Accessing Prefix Fields
9.7. Related
CLASS
es
9.8. Safe and Unsafe Assignment of
POINTER
s
9.9. Explicit Alignment of
CLASS
es
9.9.1. Aligned
CLASS
es and Foreign Languages
9.9.2. Alignment Rules for Each Platform
9.9.3. Assignment Compatibility
Tables for Chapter 9:
CLASS
es and
POINTER
s
9–3. Alignment Rules for Each Platform
Figures for Chapter 9:
CLASS
es and
POINTER
s
9–2. Fields of a Record of a Prefixed CLASS
9–4. Field Alignment under Different Alignment Rules
Examples for Chapter 9:
CLASS
es and
POINTER
s
9–1. The Use of Field Variables
10. Records
10.1. Inplace Records
10.2. Dynamic Records
10.3. Inplace Record Declaration
10.4. Declaration of
POINTER
s to Dynamic Records
10.5. Inplace Record Allocation
10.6. Dynamic Record Allocation
10.7. Inplace Record Operations
10.7.1. Field Access
10.7.1.1. Fields of Record Expressions
10.7.2. Assignment
10.7.2.1. Explicit Classification and Inplace Records
10.7.3. Inplace Records as
PROCEDURE
Parameters
10.7.4. Miscellaneous Operations
10.7.4.1. Inplace Records and the Foreign Language Interface
10.8. Dynamic Record Operations
10.8.1. Field Access
10.8.1.1. Explicit Classification and Dynamic Record Fields
10.8.2. Assignment
10.8.2.1. Copying Fields from One Dynamic Record to Another
10.8.3. Dynamic Records as
PROCEDURE
Parameters
10.8.4. Miscellaneous Operations
10.9. Deallocating Inplace Records
10.10. Deallocating Dynamic Records
10.11. When to Use Inplace Records and When to Use Dynamic Records
10.12. How to Make a
PROCEDURE
Able to Take Both Inplace Records and
POINTER
s to Dynamic Records as Arguments
10.13. The Layout of Fields within a Record
10.13.1. The Layout of Fields within a Record of a Prefixed
CLASS
Figures for Chapter 10: Records
10–1. A Record with Three Fields
10–2. A POINTER p to a Dynamic Record
10–3. An Inplace Record r
11.
MODULE
s and Data Sections
11.1. Bound and Nonbound Data Sections
11.2.
MODULE
Declaration
11.3. Indirect Access to Interface Fields
11.4.
CLASS
es with
PROCEDURE
s and
CLASS
es as Prefixes of
MODULE
s
11.5. Direct Access to Interface Fields
11.6.
MODULE
Allocation and Disposal
11.7. Allocation of a Dynamic Record of a
CLASS
with
PROCEDURE
Fields
11.8. Garbage Collection of Data Sections
11.9. Establishing
MODULE
Linkage
11.10. Intermodule Consistency Checking
11.10.1. Detailed Intermodule Consistency Checking Rules, with an Example
11.11.
INITIAL
PROCEDURE
11.12.
FINAL
PROCEDURE
11.12.1.
FINAL
PROCEDURE
s and
$exitingMainsail
11.12.2. How to Avoid Problems During a Call to
exit
11.13.
GENERIC
PROCEDURE
s as Field Variables
11.14. Control Sections and
MODULE
Swapping
11.14.1. Deletion of Swap Files
11.15. Compilation of Several
MODULE
s in One File
11.16. Nonbound-Invocation
MODULE
s
Tables for Chapter 11:
MODULE
s and Data Sections
11–1. A MAINSAIL MODULE
Figures for Chapter 11:
MODULE
s and Data Sections
11–4. Accessing Data Section Fields with a POINTER
Examples for Chapter 11:
MODULE
s and Data Sections
11–2. Sample MODULE Declaration
11–3. Sample MODULE Declaration Using a CLASS
12.
ARRAY
s
12.1. Inplace
ARRAY
s
12.2. Dynamic
ARRAY
s
12.3.
ARRAY
Declarations
12.3.1. Inplace
ARRAY
Bounds
12.3.2.
LONG
ARRAY
s
12.4. Inplace
ARRAY
Allocation
12.5. Dynamic
ARRAY
Allocation
12.6. Accessing an
ARRAY
Element
12.7.
ARRAY
Bounds and Subscript Calculation Overflow
12.8.
ARRAY
Pseudofields
12.8.1.
NULLARRAY
Checking for Compiletime-Evaluated Pseudofields of
ARRAY
s
12.9. Inplace
ARRAY
Operations
12.9.1. Assignment
12.9.2. Inplace
ARRAY
s as
PROCEDURE
Parameters
12.9.3. Miscellaneous
12.9.3.1. Inplace
ARRAY
s and the Foreign Language Interface
12.10. Dynamic
ARRAY
Operations
12.10.1. Dynamic
ARRAY
Assignment
12.10.1.1. Copying Elements from One Dynamic
ARRAY
to Another
12.10.2. Dynamic
ARRAY
Initialization
12.10.3. Dynamic
ARRAY
Comparison
12.10.4. Converting a
POINTER
to an
ARRAY
and Vice Versa
12.10.5. Miscellaneous
12.10.5.1. Copying a Dynamic
ARRAY
12.10.5.2. Clearing a Dynamic
ARRAY
12.11. Deallocating Inplace
ARRAY
s
12.12. Deallocating Dynamic
ARRAY
s
12.13. How
ARRAY
s Are Stored in Memory
12.14. Unsized Inplace
ARRAY
s and Unsized
CLASS
es
12.14.1. Parameterized Records
Tables for Chapter 12:
ARRAY
s
12–1. ARRAY Pseudofields
12–3. Array
arr3
as a Matrix
Figures for Chapter 12:
ARRAY
s
12–2. Pointer Semantics of Dynamic ARRAYs
13. Intmods
13.1. Typical Use of Intmods
13.2. Intmod Directives
13.2.1. Opening Intmods and Accessing Symbols
13.2.2.
MODULE
Visibility
13.2.3. Qualified Identifiers: Low-Level Access to Identifiers from Intmods
13.2.3.1. Example of the Use of Qualified Identifiers to Distinguish between Symbols from Two Different Open Intmods
13.2.4. Individual Symbol Visibility
13.3.
RESTOREFROM
and
SAVEON
13.4. Visibility from Supporting Intmods When a
RESTOREFROM
Is Done
13.5.
MAKEMODULEALLVISIBLE
13.6. Unqualified Identifier Search Rules
13.7. Use of Symbols from an Intmod
13.7.1. Redefining Macros from Intmods
13.7.2.
CLASS
es Declared in Different Intmods Are Different
CLASS
es
13.8. Intmod Search Rules
13.9. Changing an Intmod
13.9.1. Innocuous Intmod Changes
13.10. Intmods vs. the
SOURCEFILE
Directive
Examples for Chapter 13: Intmods
13–1. Use of Intmods to Maintain Common Declarations
14. Objmods, Intmods, Libraries, and Search Rules
14.1. Objmod and Intmod File Names
14.2. Objmod and Intmod Search Rules
14.3. Summary of Search Rules
15. Macros
15.1.
DEFINE
15.2.
REDEFINE
15.3. Bracketed Text
15.4. Interactive Definition
15.5. Macro Calls
15.6. Macro Arguments
15.6.1.
REPEATABLE
Macro Parameters,
$numArgs
,
$arg
, and
$sArg
15.7. Determining Whether a Macro Argument Has Been Omitted
15.7.1. Omitted Macro Arguments and Empty Macro Arguments
15.8. Bracketed Text in Constant Expressions
15.9. Forcing Evaluation of Macro Arguments before Passing: $expandMacro and $expandExpr
15.9.1.
$expandMacro
15.9.2.
$expandExpr
15.10.
L
Cannot Be Used as a Macro Parameter If Macro Body Contains
LONG
Constants
Examples for Chapter 15: Macros
15–1. Use of REDEFINE
16. Compiler Directives and Conditional Compilation
16.1.
MESSAGE
16.2.
SOURCEFILE
16.3.
CHECK
,
NOCHECK
, and
CHECKING
16.4.
$DIRECTIVE
16.4.1.
HIDEPROC
Directive
16.4.2.
DATETIMECHECK
/
NODATETIMECHECK
Compiler Directives
16.5.
SAVEON
and
RESTOREFROM
16.6.
ENCODE
16.7.
$GLOBALREDEFINE
16.8.
DSP
and
$LDSP
16.9.
$sizeOfField
16.10.
$sizeOfValue
16.11.
$LEGALNOTICE
16.12. Conditional Compilation:
IFC
,
THENC
,
$EFC
,
ELSEC
, and
ENDC
16.13.
$CASEC
: Compiletime Case
16.13.1. Selectors
16.13.2. Selector Matching Rules
16.13.3. Delimiters of Selected Text
16.14.
$BEGINC
16.15.
$DOC
,
$DONEC
,
$CONTINUEC
,
$FORC
: Compiletime Iteration
16.15.1.
$DOC
iteratedText
ENDC
16.15.2.
$DONEC
and
$CONTINUEC
16.15.3.
$FORC
16.16. Conditional Compilation and End-of-File
16.17.
DCL
16.18.
$TYPEOF
16.19.
$CLASSOF
16.20.
$ISCONSTANT
16.21. Scanning Directives
16.22.
NEEDBODY
and
NEEDANYBODIES
16.23.
$compileTimeValue
16.24.
$def
17. Optimization and Checking
17.1. Optimization
17.1.1.
$compileTimeValue
("
OPTIMIZE
")
17.2. Checking
17.2.1.
$compileTimeValue
("
CHECKINGSTATUS
")
,
$compileTimeValue
("
LOCALCHECKINGSTATUS
")
, and
CHECKING
17.3. Arithmetic Checking
17.4. Uninitialized Variable Checking
17.5. When Checking May Fail to Raise an Exception
Tables for Chapter 17: Optimization and Checking
17–1. Effects of Optimization Directives outside Any PROCEDURE Body or Specified as a Compiler Subcommand
17–2. Effects of Optimization Directives inside a PROCEDURE p
17–3. Effects of Checking Directives outside Any PROCEDURE Body or Specified as a Compiler Subcommand
17–4. Effects of Checking Directives inside a PROCEDURE p
18.
SUPERCHECK
18.1. What
SUPERCHECK
Checks
18.1.1. Implementation Overview: Data Field References
18.1.2. Implementation Overview: Intermodule Calls
18.1.3. Implementation Overview:
$PROCVAR
Calls
18.2. Decreased Frequency of
POINTER
Rigging:
DELAYRIGPTRS
18.3. Effect of
SUPERCHECK
on Speed
18.4. Effect of
SUPERCHECK
on Size
19. Compiletime Execution of Arbitrary MAINSAIL Code:
$expr
,
$STMT
, and
$UNDCL
19.1.
$expr
19.2.
$STMT
19.3. Identifiers That May Be Accessed by
$expr
s and
$STMT
s
19.4.
$UNDCL
19.5. A Sophisticated Example of
$STMT
,
$expr
, and
$UNDCL
: Using the Contents of a File as the Initialization Specifiers in an
INIT
Statement
Examples for Chapter 19: Compiletime Execution of Arbitrary MAINSAIL Code:
$expr
,
$STMT
, and
$UNDCL
19–1. Initialization Specifiers from a File without the Use of an Auxiliary Temporary File
19–2. Initialization Specifiers from a File Using an Auxiliary Temporary File
20. Exceptions
20.1.
$HANDLE
Statement
20.2. Handling Exceptions
20.3. Propagating Exceptions
20.4. Information about the Current Exception
20.5. Nested Exceptions
20.5.1. Exceptions Raised While an Exception with
$cannotFallOut
Set Is Being Handled
20.6. Aborting
PROCEDURE
s
20.7. Exception Naming Conventions
20.8. Predefined Exceptions
20.8.1.
$abortProgramExcpt
and
$systemExcpt
20.9. Informational Exceptions
20.10.
errMsg
Response Abbreviations
20.10.1. Sample Use of Registered Exceptions
20.11. Visualizing Exceptions
Tables for Chapter 20: Exceptions
20–1. System PROCEDUREs, Variables, and Macros for Exceptions
Figures for Chapter 20: Exceptions
20–2. Stack Diagrams in the Absence of Exceptions and $HANDLE Statements
20–3. Depiction of a Handle Frame
20–4. An Exception Is Caught by the First Ready Handler down the Stack
20–5. An Exception is Propagated by a Call to $raise with No Arguments
20–6. Frames Invoked from a Handler
20–7. Exception Raised in a Handler
20–8. $abortProcedureExcpt is Raised in All Handle Frames in PROCEDUREs That Are Being Aborted
21. Coroutines
21.1. Coroutine Facilities
21.2. Coroutine Implementation
21.3. Coroutines and Exceptions
21.4. C Exceptions and MAINSAIL Coroutines
Tables for Chapter 21: Coroutines
21–1. System PROCEDUREs, Variables, and Macros for Coroutines
Examples for Chapter 21: Coroutines
21–2. Generator/Processor Coroutines
21–3. Coroutine Tree
22. Files
22.1. File Names
22.2. The
CLASS
es
file
,
textFile
, and
dataFile
22.3. Text Files
22.4. Data Files
22.5. Input and Output
22.6. Sequential and Random Access
22.7. End-of-File Positions
22.8. Opening a File
22.9. Closing a File
22.10. Terminal I/O and Primary Input and Output
22.11. Device
MODULE
s
22.12.
cmdFile
and
logFile
and MAINSAIL Standard Input and Output
22.13.
errorOK
and File I/O
22.14. End-of-Line Conventions
22.14.1.
CRLF
Device Prefix
22.14.2.
LF
Device Prefix
22.14.3. Changing the Default Text File Device Prefix
22.14.4. Converting
CRLF
Files to
LF
Files and Vice Versa
22.15.
cmdFile
and
logFile
Echoing
22.16. Caching of Files
22.16.1. Background: Buffered I/O
22.16.2. Introduction to the File Cache
22.16.3. File Cache
PROCEDURE
s
22.17. Disk I/O and the
BIGMSLBUFFERS
Environment Variable
22.18. Partial Data Reads
Tables for Chapter 22: Files
22–1. System PROCEDUREs for Files
Figures for Chapter 22: Files
22–2. File Name And Device Mapping
23. Intercepting Terminal I/O
23.1.
$ttyCls
and
$ttyMod
23.2. How to Write a
$ttyCls
MODULE
23.2.1. How to Write
$ttyCls
.
$ttyRead
23.2.2. How to Write
$ttyCls
.
$sttyWrite
and
$ttyCls
.
$ttycWrite
23.2.3. How to Set
$ttyCls
.
$ttyAttributes
23.3. Direct Terminal I/O
23.4. Sample Use of Terminal I/O Redirection and Direct Terminal I/O
Figures for Chapter 23: Intercepting Terminal I/O
23–1. Intmod with SCRIPTTTY Interface
23–2. SCRIPTTTY: $ttyCls MODULE That Maintains a Transcript
23–3. ST: Module That Uses SCRIPTTTY
24. Date and Time Facilities
24.1. Representation of Dates and Times
24.2. Information Required by MAINSAIL
24.3. GMT Conversions and
$timeSubcommandsSet
24.4. Conversion Caveats at the Start and End of Daylight Savings Time (or Other Adjusted Time)
24.5.
MAINEX
Time Subcommand Values Appropriate to the Forty-Eight Contiguous United States
Tables for Chapter 24: Date and Time Facilities
24–1. System PROCEDUREs and Macros for Date and Time
24–2. MAINEX Time Subcommand Values for the Contiguous United States
24–3. Subcommands Defining the Names of the Time Zones in the Forty-Eight Contiguous United States
24–4. Subcommands for the Eastern Time Zone: from the Atlantic Seaboard West through Michigan, Eastern Kentucky, Eastern Tennessee, Georgia, and Florida Exclusive of the Panhandle
24–5. Subcommands for Indiana except Parts of the Extreme West
24–6. Subcommands for the Central Time Zone: Wisconsin, Illinois, Parts of Extreme Western Indiana, Western Kentucky, Western Tennessee, Alabama, the Florida Panhandle, Mississippi, Louisiana, Arkansas, Missouri, Iowa, Minnesota, Eastern North Dakota, Eastern South Dakota, Eastern Nebraska, Kansas except Parts of the Extreme West, Oklahoma, and Texas except the Extreme West
24–7. Subcommands for the Mountain Time Zone: Western North Dakota, Western South Dakota, Western Nebraska, Parts of Extreme Western Kansas, Extreme Western Texas, New Mexico, Colorado, Wyoming, Montana, Southern Idaho, Parts of Extreme Eastern Oregon, and Utah
24–8. Subcommands for Arizona
24–9. Subcommands for the Pacific Time Zone: Northern Idaho, Washington, Oregon except Parts of the Extreme East, Nevada, and California
25. Areas
25.1. Examples and Motivation
25.2. Area Facilities
25.2.1. Allocation, Clearing, and Disposal
25.2.2. Specifying Memory Management Attributes of an Area
25.3. Inaccessible Areas
25.4. Anchored Areas
25.4.1. When to Use Anchored Areas
25.4.2. How to Anchor an Area
25.4.3. Compatibility of
$anchored
with Other Area Attributes
25.4.4. Preallocated Space for Areas
25.5. Area Caveats
Figures for Chapter 25: Areas
25–1. POINTER Assignment That Violates the Bits Specified in $newArea's attr Argument
25–2. Dangling POINTERs and STRINGs after an Area Is Disposed
26. Portable Data Format (PDF)
26.1. Introduction
26.2. PDF I/O
26.2.1. PDF I/O and
$storageUnit
/
$page
I/O
26.3. Opening a File for PDF I/O
26.4. Positions in a File Opened for PDF I/O
26.5.
$ioSize
26.6. PDF Example
Tables for Chapter 26: Portable Data Format (PDF)
26–1. Portable Data Format (PDF) Representation of Data
Figures for Chapter 26: Portable Data Format (PDF)
26–2. PDF Data Files vs. Host Data Files
26–4. How to Run FVIEW
Examples for Chapter 26: Portable Data Format (PDF)
26–3. Data-Format-Independent I/O
27. Potential Pitfalls in Moving a 32-Bit MAINSAIL Application to 64-Bit MAINSAIL
27.1. Constants
27.2. Alignment Gaps
27.3. Relationship between MAINSAIL and C Data Types
27.4. Assumption That
size
(
realCode
)
=
size
(
longBitsCode
))
27.5. Assumption That
size
(
longBitsCode
)
=
32
27.6. Data Files
27.7. FLI Parameter Data Types and C Data Type Macros
27.8. PDF
28. Generalized Parameter Files
28.1. The
v
1620
.
prm
File
28.2. Format of a Parameter File
28.3. Parameter Groups Used by XIDAK Software
28.3.1. The Group
$MAINEX
28.3.2. The Group
$COMPIL
28.3.3. The Group
$MAINEDIT
28.3.4. The Group
$MAINED
28.3.5. The Group
$MAINDEBUG
28.3.6. Sample Parameter File
28.4. How to Process Parameters in a Program
28.5. Recommendations for Use of Parameters
Figures for Chapter 28: Generalized Parameter Files
28–1. PROCEDUREs for Processing Parameters
29. Introduction to System
PROCEDURE
s, Macros, and Variables
29.1. System
PROCEDURE
s and Garbage Collection
29.2. The
$BUILTIN
PROCEDURE
Qualifier
29.3. The
SPECIAL
PROCEDURE
Qualifier
29.4. Area Facility Declarations
29.5. System Procedures, Variables, and Macros Summary
Tables for Chapter 29: Introduction to System
PROCEDURE
s, Macros, and Variables
29–1. System Procedures, Macros, and Variables Summary
30. System Identifiers Beginning with “A”
30.1.
$abortProcedureExcpt
30.2.
$abortProgramExcpt
30.3.
abs
30.4.
aCos
30.5.
$addDefinedTimeZone
30.6.
$addMemMngModule
30.7.
$addToDateAndTime
30.8.
$adrOfFirstElement
30.9.
$allYearDigits
30.10.
$almostOutOfMemoryExcpt
30.11.
aLoad
30.12.
alterOK
30.13.
$anchored
30.14.
append
30.15.
$applySearchPath
30.16.
$areaOf
30.17.
$arg
30.18.
$arithmeticExcpt
30.19.
aSin
30.20.
$assembleDate
30.21.
$assembleDateAndTime
30.22.
$assembleTime
30.23.
aTan
30.24.
$atan2
30.25.
$atLeastOneDigitAfterDot
30.26.
$attributes
Figures for Chapter 30: System Identifiers Beginning with “A”
30–1. $abortProcedureExcpt
30–2. $abortProgramExcpt
30–3. abs (GENERIC)
30–4. aCos (GENERIC)
30–5. $addDefinedTimeZone
30–6. $addMemMngModule
30–7. The CLASS $memMngModule
30–8. $addToDateAndTime
30–9. $adrOfFirstElement
30–10. $allYearDigits
30–11. $almostOutOfMemoryExcpt
30–12. alterOK
30–13. $anchored
30–14. append
30–15. $applySearchPath and $getSearchPath
30–16. $areaOf (GENERIC)
30–17. $arithmeticExcpt
30–18. aSin (GENERIC)
30–19. $assembleDate
30–20. $assembleDateAndTime
30–21. $assembleTime
30–22. aTan (GENERIC)
30–23. $atan2 (GENERIC)
30–24. What the Return Value from $atan2 Represents
30–25. $atLeastOneDigitAfterDot
30–26. $attributes
31. System Identifiers Beginning with “B”
31.1.
$baseType
31.2.
$bGet
31.3.
$bigEndian
31.4.
binary
31.5.
bind
31.5.1. Handling Errors from bind
31.6.
$bitsPerChar
31.7.
$bitsPerStorageUnit
31.8.
bLoad
31.9.
bMask
31.10.
$boGet
31.11.
boLoad
31.12.
break
31.13.
$briefFormat
31.14.
$bsFormat
Tables for Chapter 31: System Identifiers Beginning with “B”
31–5. Valid Bits for bind ctrlBits
Figures for Chapter 31: System Identifiers Beginning with “B”
31–1. $baseType
31–2. $bigEndian
31–3. binary
31–4. bind (GENERIC)
31–6. $bitsPerChar
31–7. $bitsPerStorageUnit
31–8. bMask
31–10. break
31–11. $briefFormat
31–12. $bsFormat
Examples for Chapter 31: System Identifiers Beginning with “B”
31–9. Use of bMask
32. System Identifiers Beginning with “C”
32.1.
$canFindModule
32.2.
$cannotFallOut
32.3.
$cannotReturn
32.4.
$canReclaimStrings
32.5.
$caseIndexExcpt
32.6.
$CDOUBLE
32.7.
ceiling
32.8.
$CFLOAT
32.9.
$changeAreaParms
32.10.
$CHAR
32.11.
$characterRead
32.12.
$characterWrite
32.13.
$CHARBITS
32.14.
$charSet
32.15.
$charsPerPage
32.16.
$charsPerStorageUnit
32.17.
$checkConsistency
32.18.
$CINT
32.19.
$CINTBITS
32.20.
$classDscrFor
32.21.
$classInfo
32.22.
$className
32.22.1.
$className
of a Data Section
32.23.
clear
32.24.
$clearArea
32.25.
$clearFileCache
32.26.
$cleartDelayPtrRigging
32.27.
$clearStrSpc
32.28.
cLoad
32.29.
$CLONG
32.30.
$CLONGBITS
32.31.
close
32.32.
$closedFile
32.33.
closeLibrary
32.34.
$clrConfigurationBit
32.35.
$clrSystemBit
32.36.
cmdFile
32.37.
$cmdFileEofExcpt
32.38.
cmdMatch
32.38.1. The Default Case (No Bits Set in
ctrlBits
)
32.38.2. Non-Default Cases (
ctrlBits
is Non-Zero)
32.38.3. Examples of
cmdMatch
32.38.4. The
upperCase
Bit to
cmdMatch
32.39.
$collect
32.40.
$collectableChkSpc
32.41.
$collectableStrSpc
32.42.
$collectLock
32.43.
$compactableChkSpc
32.44.
compare
32.45.
$compareIntmods
32.46.
$compareObjmods
32.47.
$compile
32.48.
$compileTimeValue
32.49.
$composeFileName
32.50.
$composePath
32.51.
$concat
32.52.
confirm
32.53.
$convertDateAndTime
32.54.
copy
32.55.
$copyDirectory
32.56.
$copyFile
32.57.
$copyStringToField
32.58.
$coroutineExcpt
32.59.
cos
32.60.
cosh
32.61.
$cot
32.62.
$cpuID
32.63.
$cpuTime
32.64.
$cpuTimeResolution
32.65.
$cr
32.66.
cRead
32.67.
create
32.68.
$createClassDscr
32.69.
$createCoroutine
32.70.
$createDirectory
32.71.
$createParameterizedRecord
32.72.
$createRecord
32.73.
$createUniqueFile
32.74.
$cScan
32.75.
$CSHORT
32.76.
$CSHORTBITS
32.77.
$cStr
32.78.
$CSTRUCT
32.79.
$currentDirectory
32.80.
cva
32.81.
cvAry
32.82.
cvb
32.83.
$cvbo
32.84.
cvc
32.85.
cvcs
32.86.
$cvFieldToString
32.87.
$cvFieldToStringInPlace
32.88.
cvi
32.89.
cvl
32.90.
cvlb
32.91.
cvli
32.92.
cvlr
32.93.
cvp
32.94.
cvr
32.95.
cvs
32.95.1. The
BOOLEAN
Form of
cvs
32.95.2. The
(
LONG
)
INTEGER
Forms of
cvs
32.95.3. The
(
LONG
)
REAL
Forms of
cvs
32.95.4. The
(
LONG
)
BITS
Forms of
cvs
32.95.5. The
STRING
Form of
cvs
32.96.
cvu
32.97.
cWrite
Figures for Chapter 32: System Identifiers Beginning with “C”
32–1. $canFindModule
32–2. $cannotFallOut
32–3. $cannotReturn
32–4. $canReclaimStrings
32–5. $caseIndexExcpt
32–6. ceiling (GENERIC)
32–8. $changeAreaParms
32–9. $characterRead
32–10. $characterWrite
32–11. $charSet
32–12. $charsPerPage
32–13. $charsPerStorageUnit
32–14. $checkConsistency
32–15. $classDscrFor
32–16. $classInfo
32–18. $className
32–20. clear (GENERIC)
32–22. $clearArea
32–23. $clearFileCache
32–24. $cleartDelayPtrRigging
32–25. $clearStrSpc
32–27. Effects of $clearArea and $clearStrSpc
32–28. cLoad
32–30. close
32–32. $closedFile
32–33. closeLibrary
32–35. $clrConfigurationBit
32–36. $clrSystemBit
32–37. cmdFile
32–38. $cmdFileEofExcpt
32–39. cmdMatch
32–40. $collect
32–41. $collectableChkSpc
32–42. $collectableStrSpc
32–43. $collectLock
32–44. $compactableChkSpc
32–45. compare
32–47. $compileTimeValue
32–48. $composeFileName
32–49. $composePath
32–50. $concat
32–51. confirm
32–52. $convertDateAndTime
32–53. copy (GENERIC)
32–55. $copyDirectory
32–56. $copyFile
32–57. $copyStringToField
32–58. $coroutineExcpt
32–59. cos (GENERIC)
32–60. cosh (GENERIC)
32–61. $cot (GENERIC)
32–62. $cpuID
32–63. $cpuTime
32–64. $cpuTimeResolution
32–65. $cr
32–66. cRead (GENERIC)
32–67. create
32–68. $createClassDscr
32–70. $createCoroutine
32–71. $createDirectory
32–72. $createParameterizedRecord
32–73. $createRecord
32–75. $createUniqueFile (GENERIC)
32–76. $cScan
32–77. $cStr
32–78. $currentDirectory (GENERIC)
32–79. cva (GENERIC)
32–81. cvAry (GENERIC)
32–82. cvb (GENERIC)
32–84. $cvbo
32–85. cvc (GENERIC)
32–87. cvcs
32–89. $cvFieldToString
32–90. $cvFieldToStringInPlace
32–91. cvi (GENERIC)
32–93. cvl (GENERIC)
32–95. cvlb (GENERIC)
32–98. cvli (GENERIC)
32–100. cvlr (GENERIC)
32–102. cvp (GENERIC)
32–104. cvr (GENERIC)
32–105. cvs (GENERIC)
32–109. cvu (GENERIC)
32–111. cWrite (GENERIC)
Examples for Chapter 32: System Identifiers Beginning with “C”
32–7. Use of ceiling
32–17. Use of $classInfo
32–19. Behavior of $className with Data Section Arguments
32–21. Use of clear for a Dynamic ARRAY
32–26. Use of $clearStrSpc
32–29. Use of cLoad
32–31. Use of close
32–34. Use of closeLibrary
32–46. Use of compare
32–54. Use of copy
32–69. Use of $createClassDscr
32–74. Use of $createRecord
32–80. Use of cva
32–83. Use of cvb
32–86. Use of cvc
32–88. Use of cvcs
32–92. Use of cvi
32–94. Use of cvl
32–96. Use of cvb
32–97. Use of cvlb
32–99. Use of cvli
32–101. Use of cvlr
32–103. Use of cvp
32–106. Use of (LONG) INTEGER Forms of cvs
32–107. Use of (LONG) REAL Forms of cvs
32–108. Use of (LONG) BITS Forms of cvs
32–110. Use of cvu
32–112. Use of the File and STRING Forms of cWrite
32–113. Use of the CHARADR Form of cWrite
33. System Identifiers Beginning with “D”
33.1.
$data
33.2.
$dataSecPart
33.3.
$date
33.4.
$dateAndTime
33.5.
$dateAndTimeCompare
33.6.
$dateAndTimeDifference
33.7.
$dateAndTimeToStr
33.8.
$dateFormat
33.9.
$dateToStr
33.10.
$debugExec
33.11.
$decomposeFileName
33.12.
$decomposePath
33.13.
$def
33.14.
$defaultArea
33.15.
delete
33.16.
$delete
33.17.
$deleteDirectory
33.18.
$deregisterException
33.19.
$descendantKilledExcpt
33.20.
$devModBrk
33.21.
$devModBrkStr
33.22.
$directory
33.22.1. Transforming a Directory Name into a Relative Path Name
33.23. Direct Terminal I/O Routines
33.24.
$disassembleDate
33.25.
$disassembleDateAndTime
33.26.
$disassembleTime
33.27.
discard
33.28.
displace
33.29.
displacement
33.30.
dispose
33.31.
$disposeArea
33.32.
$disposeDataSecsInArea
33.33.
$disposedDataSecExcpt
33.34.
$doNotAllocateInStaticPool
33.35.
$doNotClear
33.36.
$doNotIncludeTimeZone
33.37.
$doNotMatch
33.38.
$doNotRaise
33.39.
$dscrPtr
33.40.
DSP
33.41.
$dup
Figures for Chapter 33: System Identifiers Beginning with “D”
33–1. $data
33–2. $dataSecPart
33–3. $date
33–4. $dateAndTime
33–5. $dateAndTimeCompare
33–6. $dateAndTimeDifference
33–7. $dateAndTimeToStr
33–8. $dateFormat
33–9. $dateToStr
33–10. $decomposeFileName
33–11. $decomposePath
33–12. $defaultArea
33–13. delete
33–14. $delete
33–15. $deleteDirectory
33–16. $deregisterException
33–17. $descendantKilledExcpt
33–18. $devModBrk
33–19. $devModBrkStr
33–21. $directory (GENERIC)
33–22. Direct Terminal I/O Routines
33–23. $disassembleDate
33–24. $disassembleDateAndTime
33–25. $disassembleTime
33–26. discard
33–27. displace (GENERIC)
33–29. displacement (GENERIC)
33–31. dispose (GENERIC)
33–32. $disposeArea
33–33. $disposeDataSecsInArea
33–34. $disposedDataSecExcpt
33–35. $doNotAllocateInStaticPool
33–36. $doNotClear
33–37. $doNotIncludeTimeZone
33–38. $doNotMatch
33–39. $doNotRaise
33–40. $dscrPtr
33–41. $dup
Examples for Chapter 33: System Identifiers Beginning with “D”
33–20. Use of $devModBrkStr
33–28. Use of displace
33–30. Use of displacement
34. System Identifiers Beginning with “E”
34.1.
enterLogicalName
34.2.
eof
34.3.
eol
34.4.
eop
34.5.
equ
34.6.
errMsg
34.7.
errorOK
34.8.
$exceptionBits
34.9.
$exceptionCoroutine
34.10.
$exceptionName
34.11.
$exceptionPointerArg
34.12.
$exceptionStringArg1
34.13.
$exceptionStringArg2
34.14.
$excludeSeconds
34.15.
$executeIntlibCommands
34.16.
$executeMainpmCommands
34.17.
$executeModlibCommands
34.18.
$executeStampCommands
34.19.
exit
34.20.
$exitingMainsail
34.21.
exp
34.22.
$expandExpr
and
$expandMacro
34.23.
exponent
34.24.
$exponentExcpt
34.25.
$expr
Figures for Chapter 34: System Identifiers Beginning with “E”
34–1. enterLogicalName
34–2. eof
34–3. eol
34–4. eop
34–5. equ
34–7. errMsg
34–8. errorOK
34–9. $exceptionBits
34–10. $exceptionCoroutine
34–11. $exceptionName
34–12. $exceptionPointerArg
34–13. $exceptionStringArg1
34–14. $exceptionStringArg2
34–15. $excludeSeconds
34–16. exit
34–17. $exitingMainsail
34–18. exp (GENERIC)
34–19. exponent
34–20. $exponentExcpt
Examples for Chapter 34: System Identifiers Beginning with “E”
34–6. Use of equ
35. System Identifiers Beginning with “F”
35.1.
fastExit
35.2.
fatal
35.3.
$fieldInfo
35.4.
$fileInfo
35.5.
$findArea
35.6.
$findCoroutine
35.7.
first
35.8.
$findGroup
35.9.
fixed
35.10.
$fixFormat
35.11.
fldRead
35.12.
fldWrite
35.13.
floor
35.14.
$flush
35.15.
$formatAsParagraph
35.16.
formatted
35.17.
$formParagraph
35.18.
$fullPathNames
Figures for Chapter 35: System Identifiers Beginning with “F”
35–1. fastExit
35–2. fatal
35–3. $fieldInfo
35–4. $fileInfo (GENERIC) and $fileInfoCls
35–5. $findArea