Errors

In computer jargon, an error is referred to as a bug . In case you are interested in the origin of this word, the story goes that when operating the first large-scale digital computer, called the Mark I, an error was traced to a moth that had found its way into the hardware. Incidentally, the Mark I (circa 1944) had 750,000 parts, was 51 feet long, and weighed over 5 tons. How about putting that on your desktop? It also executed about one instruction every 6 seconds, as compared to over 200 million instructions per second for a Pentium!

Errors can be grouped into three types based on when they occur — design time, compile time, or run time.

Design-Time and Compile-Time Errors

As the name implies, a design-time error occurs during the writing of code. Perhaps the nicest feature of the Visual Basic Editor is that it can be instructed to watch as we type code and stop us when we make a syntax error. This automatic syntax checking can be enabled or disabled in the Options dialog box shown in Figure 9.3, but I strongly suggest that you keep it enabled.

The Options dialog box

Figure 9-3. The Options dialog box

Notice also that there are other settings related to the design-time environment, such as how far to indent code in response to the Tab key. We will discuss some of these other settings a bit later.

To illustrate automatic syntax checking, Figure 9.4 shows what happens when we deliberately enter the ...

Get Access Database Design and Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.