Date

Teresa Lopes on the Net

–interesting ideas to share–
Breast Cancer Ribbon

Archive for the ‘Computers and Internet’ Category

Subroutines

posted by:

Subroutine can be thought of as miniature programs. A subroutine has a name attributed with it, much like a variable does. Unlike a variable, a subroutine doesn’t hold data. Instead it holds code. When the code in a subroutine is executed, the subroutine is said to be “called”. ‘Call’ is use in calling subroutines. Some subroutines are called automatically when certain actions are performed.

Subroutines are used to eliminate redundancy. Consider the complicated programs such as Point of Sale System, Inventory System and other system that could be created using Visual Basic. Those systems need a manageable and lesser code that could be easy to debug and decode as needed. If subroutines are not use, all of the repeated code will be type in every form in the system. Debugging of those codes will be difficult to track down. Through the subroutines, code will be written once and can be called. In this case, the programmer can easily trace the errors and ready for debugging and making the entire program easier and manageable.