NerdPlanet's e-learning Blog
Nerdplanet's Blog is an elearning community site which is created to help people who have a passion about computers and in a confused state in choosing the right direction to follow for obtaining the right knowledge. Here we focus mainly on providing Tutorials on Operating systems (Windows /Linux), Networking (Routers/Firewall Configuration) and programming, which would help people to understand the basics clearly and to help them further to learn advanced concepts. We also guide people who are in need of materials to learn but who could not afford to pay a price for it. We do this because we believe that Knowledge is power and the Knowledge should be free!. This would help to build a healthy community of IT Professionals.
Archive for the ‘General’ Category

You have finally gotten all of the bugs out of that special program that has kept you in seclusion for the past several weeks. It does exactly what you want it to do, and you are ready to impress someone with it. You beg your boss to take time from his busy schedule for a session with your Apple, and after ten minutes of routine data entry, your program is nearing its flashy finale.

The next question appears: “How many sides on an octogon?” As your boss enters
“e..i..g…”, you stifle, “Not that key, you dummy, the ‘8′”. Too late… The Apple has already responded with a “TYPE MISMATCH” message and shut your program. One purpose of an “error trap” or “error handling routine” is to help prevent such embarrassing situations. Your Apple’s BASIC interpreter already has several built-in error traps which were designed to protect the system from your unreasonable requests, such as attempts to divide by zero or to exceed to system’s capacity (”STRING TOO LONG”, “OVERFLOW”, “FORMULA TOO COMPLEX”, “OUT OF MEMORY”). Fortunately for many applications, these traps can be avoided by
using the ONERR GOTO…..POKE 216,0 commands. ONERR GOTO… disables the system’s internal error handling routine and, upon encountering an error, transfers program processing to a statement defined by the GOTO statement, typically a replacement error handling routine of your design. The POKE 216,0 command reinstates the system’s error handling routine.

For many beginning programmers, disabling the system’s error handling routine, only to replace it with one that you must design and which uses some of your precious RAM memory seems like lunacy. The major reason for doing so is that most of the errors to which the system reacts need not be fatal to your run. The computer views these errors as fatal because the contexts in which they may occur are so diverse that the only general solution that ensures protection to your computer is to terminate your run. However, within your program the context within which an error may occur can often be much more narrowly defined, and nonfatal solutions may be developed. Some of these solutions are described below.

Read the rest of this entry »