Skip to main content Accessibility help
×
Hostname: page-component-7479d7b7d-68ccn Total loading time: 0 Render date: 2024-07-13T02:30:01.917Z Has data issue: false hasContentIssue false

7 - Procedures and Functions – Divide and Conquer

Published online by Cambridge University Press:  05 June 2012

Jim McKeown
Affiliation:
Dakota State University
Get access

Summary

VB Quip

Specialists learn more and more about less and less until they know everything about nothing. Generalists learn less and less about more and more until they know nothing about everything.

Anonymous

We live in a world of specialization. Want a cup of coffee? There's a store that specializes in coffee, any way you like it. Need a doughnut to go with it? There's a company that makes and sells the best doughnuts. Need something to read while you're enjoying a bite? Pick from thousands of magazines or millions of books on any and all topics imaginable. Gone are the days of the local handyman – the resident “Mr. Fixit” – who could fix anything and get anything to work. Today's world has specialists. A mechanic specializes in car repair. The cable guy handles your TV problems. When the office copier is on the fritz, call the copier guy. Everyone's an expert.

Programming is the same way. Blocks of code are written for a particular purpose. Some do simple tasks, but do them often. It's easier to write a procedure once for a task and then call it multiple times as needed. Other blocks of code might do a complicated calculation or solve a particular problem. These provide a specific function. It's easier to write and store these functions and then use them when needed than it is to create them from scratch. That's the basis for procedures and functions.

Type
Chapter
Information
Programming in Visual Basic 2010
The Very Beginner's Guide
, pp. 224 - 257
Publisher: Cambridge University Press
Print publication year: 2010

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×