137. Errors in a procedure can be handled with an optional argument.#

topic: Procedures

Note

This tip is a draft1.

Errors in a procedure can be handled by setting an error flag and returning or by stopping with an error message. A procedure with an optional error flag argument can handle errors in either way, depending on whether an error flag is passed.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.