WDBFPO.COM Version 2
Which DBF file is associated with which NDX files?
by P. L. Olympia
Darwin BBS, 301-251-9206
NOTE: Version 1.0 released in July had a BUG (yuk!)
All should get rid of WDBFPO.COM dated 7/18/87 or 7/24/87.
If you find any more gremlins, please let me know.
You know the problem only too well. Your development group is writing a
very large dBASE application system with dozens of data base files and
an even larger number of index files. Every so often, someone wants to
know which NDX files go with which DBF files. You need a script just to
get everything straight. But why? In dBASE there is nothing in either
an NDX or DBF file that associates one to the other, just like there is
nothing in a memo (DBT) file, save its filename, that associates it with
the corresponding DBF file.
Enter INSERT and PICKIT, two programs from the Shareware dBASE III
debugging utilities package, DB_DBUG2.ARC, by Curtis Hoffman. You use
INSERT to embed into an NDX file the name of a DBF file with which it is
associated. INSERT depends on the fact that the current NDX file
structure for dBASE has unused areas in the header record. The program
simply writes the DBF name (which you supply) in one of those unused
areas. You use the related program, PICKIT, to show the name of the
DBF file that was previously recorded by INSERT. Incidentally, the
DB3_HDR.DOC file is wrong about the space occupied by the index key
expression: it should be 100 bytes, not 256.
Do you really need two programs, each 12K in size, to record and
display the DBF name tag of an index file? And wouldn't it be more
useful if you could tag a whole set of NDX files with one command
WDBFPO (Which DBF by PO) corrects the deficiencies in Curtis' programs.
It can process wildcards and the same program can be used to tag, or
display tags of, NDX files. Whether it records or displays a DBF tag
depends on how many arguments you supply in the command line.
will tag the NDX files, while
will display any recorded tags.
WDBFPO D:T*.NDX MYDBF
tags with the word "MYDBF" all the NDX files on the D: drive with
filenames that begin with a "T". The command:
will display the tags (if any) of all NDX files in the default
The program works for both dBASE II and III. In principle, the tag can
be any label no more than 11 characters long. An example of the
program's output is:
Index File DBF Tag
AND NOW A WORD FROM YOUR SPONSOR
WDBFPO was written in C. It is small partly because it does not use the
printf() function. The program is part of a tutorial on C for dBASE
programmers in a soon-to-be-published book, "dBASE Power: Creating and
Using Programming Tools." The book tells you how to write in C and ASM,
how to write BIN routines, how to create your own dBASE "power" (ugh!)
tools (and more).
The book also tells you how to read a dBASE report format (FRM) file,
modify it with your text editor, and create an FRM file from DOS.
Naturally, the C programs to do those are in the book. Sounds good?
When the book hits the stands, BUY IT. Ok?