Skip to main content

Part of the book series: Macmillan Computer Science Series ((COMPSS))

  • 19 Accesses

Abstract

It may happen that a particular set of actions has to appear several times in a solution. We may avoid writing out the Pascal statements at every place they are required, by defining them to be a ‘procedure’. A procedure gives a name to a set of actions, which may then be invoked or ‘called’ merely by referring to the name. This has the additional advantage of increased readability, of which more below and in chapter 13. A complete procedure is a declaration which must appear after the var declarations. Its form is as shown in figure 6.1. This is similar to the definition of a program given in chapter 2. A procedure may be considered as a program dedicated to some subtask of the problem, thus simplifying the over-all solution (see section 6.5 and chapter 13).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Copyright information

© 1982 I. R. Wilson and A. M. Addyman

About this chapter

Cite this chapter

Wilson, I.R., Addyman, A.M. (1982). An Introduction to Procedures and Functions. In: A Practical Introduction to Pascal — with BS 6192. Macmillan Computer Science Series. Palgrave, London. https://doi.org/10.1007/978-1-349-06364-2_6

Download citation

  • DOI: https://doi.org/10.1007/978-1-349-06364-2_6

  • Publisher Name: Palgrave, London

  • Print ISBN: 978-0-333-33340-2

  • Online ISBN: 978-1-349-06364-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics