Skip to main content

Procedures

  • Chapter
  • 59 Accesses

Part of the book series: Texts and Monographs in Computer Science ((MCS))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   74.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics