© John Kouraklis 2020
J. KouraklisDelphi Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-6112-5_4

4. Procedures and Functions

John Kouraklis1 
(1)
London, UK
 

Modular programming in Delphi is implemented by handling two types of routines (or methods): procedures and functions. The two types have many similarities and one difference; functions return a value to the point of call. The idea is that the code uses this value to proceed with the algorithm it implements. Procedures just execute the code. This is the rule; however, as we will see, there is a way to use procedures to modify values at the point of call.

Declaration

In practice, this difference may become blurry as you can call a function and just ignore the return value, and, as a matter ...

Get Delphi Quick Syntax Reference: A Pocket Guide to the Delphi and Object Pascal Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.