PC and software
Guided by the Anything Inventory software, your PC will record what you scan.We set these requirements for the software before we wrote it:
1. Permit barcode entry from the keyboard or a barcode reader that generates what looks like keyboard input.
2. Record each item’s barcode, description, and the inventory quantity in a database.
3. Add and remove items from inventory, and look up codes without adjusting inventory.
4. Record the dates when each item is originally entered, last added to inventory, and last removed from inventory.
5. Look up the item description for scanned barcodes on the Internet if a connection is available.
6. Export the inventory data in a format suitable for processing and reporting by other programs.
Figure 4 shows the user interface for the software.We took a minimalist approach — you pick the function you want (Lookup, Add, or Remove), enter the UPC or EAN-13 barcode number (you can have either or both in the database), and either press Enter or click the button in the window. The modified CueCat barcode scanner we use (see “Parts and Designs” later in this chapter) enters the barcode data as keyboard input and follows it with an Enter, so once you set the function a swipe of the scanner enters the data and performs the operation.

FIGURE 4: Anything Inventory UPC Internet Lookup software
Figure 4 shows the result after we scanned the barcode on the package from a Seagate hard drive. The digit sequence 763649001134 is the UPC-A barcode, and breaks down like this:
a). 7 — The number system code
b). 63649 — The five digit manufacturer code (which corresponds to Seagate Technology LLC)
c). 00113 — The manufacturer’s product identification number, corresponding to the specific drive
d). 4 — The barcode checksum
The software’s File menu contains the following commands, most of which should be familiar from other Windows software:
Open — Inventory files created by the Anything Inventory software have the extension upc. If you’ve previously saved an inventory file, you can reload it with the File Open command, or by double-clicking on it. (You’ll have to configure Windows to link the UPC extension to the EXE file for the latter to work.)
Save — You save or update an inventory file with the File Save command. If you’ve not yet defined a name for the inventory file, the program invokes the File Save As command for you.
Save As — You initially save an inventory file with the File Save As command, or save an existing file with a different name. File Save As will warn you if you attempt to save over an existing file.
Load CSV — The Internet site hosting the online database the Anything Inventory software uses also offers a subset of its entire UPC database for download to your PC. The download provides you a text file in the usual Comma Separated Value (CSV) format; the File Load CSV command will load that file into the program. You can save the result in the Anything Inventory native format with the File Save or File Save As commands.
Export Inventory — You can write your inventory to a CSV file with the File Export Inventory command. The format is not the same as that used by Load CSV; and the first line in the file is a header identifying the contents of each column. Because it’s possible to load a very large number of otherwise unused items into the inventory through the File Load CSV command, the File Export Inventory command filters the items exported to be just those whose last modification time is different from the creation time or which have been looked up on the Internet and not loaded from a file.
Exit — The program closes. You’ll be asked if you want to save your changes to an inventory file.
The file extension for the export file is intentionally .INV to prevent Microsoft Excel from autoparsing the file as it would do if the extension were the more conventional .CSV. You can convert the CSV format to columns in Excel using the Data Text-to-Columns command; import the first column (the UPC) as text to avoid truncating leading zeroes in all-numeric codes.
The software holds the entire inventory in memory, presuming you’ll not be tracking hundreds of thousands of items. That’s not a great assumption if you load a data file from the UPC Database Web site—when we loaded the complete file (475,617 items as of mid-2004), the memory required ballooned to 150MB, while the saved inventory file grew to 32MB. If you plan to use a downloaded database as a pre-load, which you might want to do if you don’t have continuous Internet access, one of the useful projects you could undertake would be to modify the software to couple it to a file-based database.
The Anything Inventory software processes both UPC-A codes and books. Figure 5 shows the difference, using our PC Upgrade and Repair Bible Desktop Edition as an example. The left image in the figure shows the product UPC-A; it’s a generic code for a book from Wiley at a specific price. The right image in the figure is unique to the specific book, and is an EAN-13 code.

FIGURE 5: Book UPC-A (left) and EAN-13 ISBN (right) barcodes
The first 3 digits of the EAN-13 code are 978, for Bookland, followed by the first 9 digits of the ISBN (076455731) and a check digit (6). The software ignores the second set of bars appended on the right. The software forms the complete ISBN by taking the first 9 digits and appending a proper ISBN check digit, which for this ISBN is the digit 9.
The Internet menu contains these commands:
Enable — You may or may not have an Internet connection when you’re using the software. The Internet Enable command lets you control whether or not the program attempts to look up unknown scanned barcodes on the Internet. If there’s a check next to the Enable item in the menu, Internet access is enabled and the program will try to do lookups. The check mark changes on/off status each time you select the command.
Force — Items the program has looked up on the Internet are not looked up again when you later scan them. Enabling the Internet Force command ensures new lookups, letting you access new or changed data on the Internet.
The Help menu contains only an About command. You could write your own help file if you wanted.