Office of Information Services - Application Programming

Subroutines -- Internal Subroutines



Overview

Internal Subroutines can be a very useful thing in a program. In InfoBasic they should primarily be used to avoid duplicating code within a program. A large percentage of InfoBasic programs are relatively short (100-200 lines of code) and perform only 1 to 2 processing actions. For these types of programs internal subroutines should rarely be used. Keeping programs linear in terms of reading usually make them easier to maintain. Rather than using internal subroutines for these programs use "white space" (blank lines or * lines) to separate the program into logical groups of coding.

Naming Subroutines


DO use:
DO NOT use:

When to use Internal Subroutines

The one exception to the above is when you have a significant group code (8-10 lines or more) which need to be done and can stand alone, but which would have a negative impact on the flow of reading the program. See XX for an example.

Leaving the Subroutine



Administrative Programming Main Menu

Programming Projects- Programming Standards- Tools Library