Direct Access Tables
Like all lookup tables, direct-access tables replace more complicated logical control structures. They are "direct access" because you don't have to jump through any complicated hoops to find the information you want in the table. As Figure 18-1 suggests, you can pick out the entry you want directly.
Figure 18-1. As the name suggests, a direct-access table allows you to access the table element you're interested in directly
Suppose you need to determine the number of days per month (forgetting about leap year, for the sake of argument). A clumsy way to do it, of course, is to write a large if statement:
Example 18-3. Visual ...