Statements

Table of Contents

ACCEPT Statement
ACCEPT Parameters
Examples of ACCEPT Statements
ASSIGNMENT Statement
Arithmetic Assignment
Array Reference Assignment
Boolean Assignment
Complex Assignment
Connection Block Reference Assignment
Mnemonic Attribute Assignment
Pointer Assignment
Procedure Reference Assignment
String Assignment
Structure Block Reference Assignment
Task Assignment
ATTACH Statement
Attachment of Interrupts
Examples of ATTACH Statements
AWAITOPEN Statement
PARTICIPATE Option
CONNECTTIMELIMIT Option
Examples of AWAITOPEN Statements
CALL Statement
Coroutines
Examples of a CALL Statement
CANCEL Statement
Delinking a Library from a Program
Example of a CANCEL Statement
CASE Statement
Unnumbered Statement List
Numbered Statement List
Examples of CASE Statements
CAUSE Statement
Causes of Events
Examples of CAUSE Statements
CAUSE1 Statement
CAUSEANDRESET Statement
Relationship to CAUSE Statement
Examples of CAUSEANDRESET Statements
CHANGEFILE Statement
Directory Element
Example of a CHANGEFILE Statement
CHECKPOINT Statement
Disposition Option
Restarting a Job
Locking
Rerunning Programs
Example of a CHECKPOINT Statement
CLOSE Statement
CLOSE Options
PORT CLOSE Option
Examples of CLOSE Statements
CONTINUE Statement
Coroutines
Examples of CONTINUE Statements
DEALLOCATE Statement
Deallocation with Arrays
Examples of DEALLOCATE Statements
DETACH Statement
Detaching Interrupts
Example of a DETACH Statement
DISABLE Statement
Disabling Interrupts
Examples of DISABLE Statements
DISPLAY Statement
Pointer and String Expressions
Examples of DISPLAY Statements
DO Statement
Evaluation of Boolean Expression
Examples of DO Statements
ENABLE Statement
Enabling Interrupts
Examples of ENABLE Statements
ERASE Statement
EVENT Statement
EXCHANGE Statement
Conditions for Execution of the EXCHANGE Statement
Examples of EXCHANGE Statements
FILL Statement
Initialization
Examples of FILL Statements
FIX Statement
FIX Statement as a Boolean Function
Examples of FIX Statements
FOR Statement
Forms of the FOR Statement
Examples of FOR Statements
FREE Statement
FREE Statement as a Boolean Function
Examples of FREE Statements
FREEZE Statement
FREEZE Statements in Library Procedures
Examples of FREEZE Statement
GO TO Statement
Bad GO TO
Examples of GO TO Statements
I/O Statement
Normal I/O
Direct I/O
IF Statement
Forms of the IF Statement
Examples of IF Statements
INTERRUPT Statement
INVOCATION Statement
LIBERATE Statement
Execution of Implicit CAUSE Statement
Examples of LIBERATE Statements
LOCK File Statement
Lock Options
Examples of LOCK File Statements
LOCK Interlock Statement
Timeout Option
Examples of LOCK Interlock Statements
MERGE Statement
Merge Options
Example of a MERGE Statement
MESSAGESEARCHER Statement
Finding a Requested Message
MESSAGESEARCHER Statement as an Arithmetic Function
Example of a MESSAGESEARCHER Statement
MLSACCEPT Statement
MLSACCEPT Used for Data Input
MLSACCEPT Used as a Boolean Function
Additional MLSACCEPT Options
Example of an MLSACCEPT Statement
MLSDISPLAY Statement
MLSTRANSLATE Statement
MLSTRANSLATE Options
MLSTRANSLATE as an Arithmetic Function
Example of an MLSTRANSLATE Statement
MULTIPLE ATTRIBUTE ASSIGNMENT Statement
Assignment of Values
Examples of MULTIPLE ATTRIBUTE ASSIGNMENT Statements
ON Statement
Enabling ON Statements
Fault List
Fault Information Part
Fault Stack History
Fault Action
Disabling ON Statement
Fault Action with No ON Statement
Examples of ON Statements
OPEN Statement
OPEN Options
Examples of OPEN Statements
POINTER Statement
POINTER Statement Options
Temporary Storage
PROCEDURE INVOCATION Statement
Calling Procedures with Parameters
Examples of PROCEDURE INVOCATION Statements
PROCEDURE REFERENCE Statement
Using Procedure References
Example of a PROCEDURE REFERENCE Statement
PROCESS Statement
Initiation of an Asynchronous Process
Critical Block
Examples of PROCESS Statements
PROCURE Statement
Testing the Available State
Sharing Resources Among Programs
Examples of PROCURE Statements
PROGRAMDUMP Statement
PROGRAMDUMP Options
Programdump Destination Options
Relation to OPTION Task Attribute
Retrieval of Binding Information
Examples of PROGRAMDUMP Statements
READ Statement
File Part
I/O Option or Carriage Control
Subfile Specification
Core-to-Core Part
Core-to-Core Blocking Part
Format and List Part
Action Labels or Finished Event
Data Format for Free-Field Input
Examples of READ Statements
REMOVEFILE Statement
Directory Element
REMOVEFILE Statement as a Boolean Function
Family Substitution
Example of a REMOVEFILE Statement
REPLACE Statement
Source Part List
Source Part Combinations
String Literal Source Parts
Arithmetic Expression Source Parts
Pointer Expression (<source>) Source Parts
Source Parts with Boolean Conditions
Other Source Parts
Examples of REPLACE Statements
REPLACE FAMILY-CHANGE Statement
Specification of Valid Stations
Examples of REPLACE FAMILY-CHANGE Statements
REPLACE POINTER-VALUED ATTRIBUTE Statement
Specification of the Simple Source
Examples of REPLACE POINTER-VALUED ATTRIBUTE Statements
RESET Statement
WAIT and WAITANDRESET Statements
Examples of RESET Statements
RESIZE Statement
Array Row Resize Parameters
Special Array Resize Parameters
Run-Time Error Messages
Examples of RESIZE Statements
RESPOND Statement
RESPOND Statement Options
Examples of RESPOND Statements
REWIND Statement
Effects on Designated Files
Example of a REWIND Statement
RUN Statement
Initiating Procedures
Examples of a RUN Statement
SCAN Statement
Scan Part Combinations
Scan Parts without Count Parts
Scan Parts with Count Parts
Examples of SCAN Statements
SEEK Statement
SEEK Statement as a Boolean Function
Example of a SEEK Statement
SET Statement
SET Statement Options
Examples of SET Statements
SETABSTRACTVALUE Statement
Setting the File Attribute
Examples of SETABSTRACTVALUE Statements
SORT Statement
Output Option
Input Option
Number of Tapes
Compare Procedure
Record Length
Size Specifications
Restart Specifications
Arrays in Sort Procedures
Examples of SORT Statements
SPACE Statement
SPACE Statement as a Boolean Function
Examples of SPACE Statements
SWAP Statement
Variable Type Matching
Example of a SWAP Statement
THRU Statement
Value of the Arithmetic Expression
Examples of THRU Statements
TRY Statement
TRY Normal Form
TRY Limited Form
Considerations for Use
UNLOCK Statement
Examples of UNLOCK Statements
WAIT Statement
Wait Option List
WAIT Parameter List
Start Index
Direct Array Row
Examples of WAIT Statements
WAITANDRESET Statement
WAITANDRESET Statement as an Arithmetic Function
Examples of WAITANDRESET Statements
WHEN Statement
Characteristics of the Time Option
Examples of WHEN Statements
WHILE Statement
Execution of the WHILE Statement
Examples of WHILE Statements
WRITE Statement
I/O Option or Carriage Control
Write Subfile Specification
Format and List Part
Action Labels or Finished Event
Examples of WRITE Statements
ZIP Statement

Statements are the active elements of an ALGOL program. They indicate an operation to be performed. Statements are normally executed in the order in which they appear in the program. A statement that transfers control to another program location can alter this sequential flow of execution. Note that a statement can be null or empty.

In this section, the ALGOL statements are listed and discussed in alphabetical order. In many cases, portions of the syntax of a statement are discussed before moving on to the next syntax segment.

The syntax for any statement is recursive: a statement can be a block or a compound statement, each of which, in turn, can include statements. For a description of the syntax of <block> and <compound statement>, see Program Structure.

Statements can be labeled or unlabeled. A <labeled statement> is of the following form:

──<label identifier>── : ──<statement>─────────────────────────────────┤

An <unlabeled statement> is any statement that does not contain a label identifier.