Information Technology Reference
In-Depth Information
will be 0. Note that that variable is not defined but based on the size of the table it will be
an appropriately sized integer. This occurs because of the combination of the keywords
search
and
found
in the definition of the table. This all takes place because the table is dynamic, meaning
it's current. From the definition of the table, all the values in the copylib member will be
available to us. The size of the table results from the copy member.
The statement,
get-city-state: search zip-table key = zip-code
means we don't have to read the zip code file anymore. There are fewer lines of code in
the program and it may run faster that Sly's program, despite his name. You can see that
the
search
keyword is quite powerful as it looks for a match and because of the way the table is
defined,
t-sub
is the row number of the match, giving us the city and state corresponding to the zip code.
There shouldn't be any situation where there isn't a match because of the connection
between the zip code table and the zip code file we used before since tech support updates
the zip code table directly from that file. We'll display an error message anyway if that
does happen.
Search WWH ::




Custom Search