Abstract
Consider the task of processing a set of data consisting of a header and a sequence of N similar individual units. It might be generally described as
-
Read Header;
-
ProcessHeader;
-
WriteHeader;
-
FOR i ; = 1 TO N DO ReadUnit; ProcessUnit; Write(i); WriteUnit
-
END
Clearly, the description of the original task has been made in terms of subtasks, emphasizing the dominant structure and supressing details. Of course, the subtasks ReadHeader, ProcessHeader, etc. must now be further described with all the necessary details. Instead of replacing these descriptive English words with elaborate Modula programs, we may consider these words as identifiers and define the details of the subtasks by textually separate pieces of program, called procedures (or subroutines); These definitions are called procedure declarations, because they define the actions of the procedure and give it a name. The identifiers in the main program referring to these declarations are said to be procedure calls, and their action is to invoke the procedure. Syntactically, the procedure call is a statement.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights and permissions
Copyright information
© 1983 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Wirth, N. (1983). Procedures. In: Programming in Modula-2. Texts and Monographs in Computer Science. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-96757-3_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-96757-3_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-96759-7
Online ISBN: 978-3-642-96757-3
eBook Packages: Springer Book Archive