Subroutines and subprograms. Subroutines and subprograms are sections of a program code that are set apart from the main program so they can be called from several places in the main program and which, after they are finished, return to the next line in the main program. They are most commonly used for code which is re-used several times in one program. All of the variables in a subroutine are global, that is, they are shared with the main program. All of the variables in a subprogram are local, that is, they are independent of the variables in the main program.
Information is passed between the subprogram and the main program by means of an argument list.
Memory access and Input and Output ports. The port number is usually determined by switch settings on the add-in card. Such data are often stored in the computer's memory as an array. Printing to the network printer from with a program. On the Macintosh, program output may be directed to the currently-selected printer on the LocalTalk network by opening the printer like it were a file.