Our examples so far have been too short to break up into sub-programs. However, any sizeable IDL project (infact any computer coding) will be easier to deal with if each specific task is put into its own sub-program, which your main program can call. You can then reuse these
Sub-programs in IDL come in three flavours: