home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / wdbfpo2.zip / WDBFPO.DOC < prev   
Text File  |  1987-08-13  |  4KB  |  106 lines

  1.                         WDBFPO.COM  Version 2
  2.             Which DBF file is associated with which NDX files?
  3.                                 08/12/87
  4.  
  5.                            by P. L. Olympia
  6.                         Darwin BBS, 301-251-9206
  7.  
  8. NOTE:  Version 1.0 released in July had a BUG (yuk!)
  9.        All should get rid of WDBFPO.COM dated 7/18/87 or 7/24/87.
  10.        If you find any more gremlins, please let me know.
  11.  
  12.  
  13. THE PROBLEM
  14. -----------
  15.  
  16. You know the problem only too well.  Your development group is writing a 
  17. very large dBASE application system with dozens of data base files and 
  18. an even larger number of index files.  Every so often, someone wants to 
  19. know which NDX files go with which DBF files.  You need a script just to 
  20. get everything straight.  But why?  In dBASE there is nothing in either 
  21. an NDX or DBF file that associates one to the other, just like there is 
  22. nothing in a memo (DBT) file, save its filename, that associates it with 
  23. the corresponding DBF file.  
  24.  
  25.  
  26. ONE SOLUTION
  27. ------------
  28.  
  29. Enter INSERT and PICKIT, two programs from the Shareware dBASE III 
  30. debugging utilities package, DB_DBUG2.ARC, by Curtis Hoffman.  You use 
  31. INSERT to embed into an NDX file the name of a DBF file with which it is 
  32. associated.  INSERT depends on the fact that the current NDX file 
  33. structure for dBASE has unused areas in the header record.  The program 
  34. simply writes the DBF name (which you supply) in one of those unused 
  35. areas.   You use the related program, PICKIT, to show the name of the 
  36. DBF file that was previously recorded by INSERT.  Incidentally, the 
  37. DB3_HDR.DOC file is wrong about the space occupied by the index key 
  38. expression: it should be 100 bytes, not 256.
  39.  
  40. Do you really need two programs, each 12K in size, to record and 
  41. display the DBF name tag of an index file?  And wouldn't it be more 
  42. useful if you could tag a whole set of NDX files with one command 
  43. invocation?
  44.  
  45.  
  46. THE SOLUTION
  47. ------------
  48.  
  49. WDBFPO (Which DBF by PO) corrects the deficiencies in Curtis' programs. 
  50. It can process wildcards and the same program can be used to tag, or 
  51. display tags of, NDX files. Whether it records or displays a DBF tag 
  52. depends on how many arguments you supply in the command line.
  53.  
  54.      WDBFPO <ndx-filenames> <dbf-tag>
  55.  
  56. will tag the NDX files, while
  57.  
  58.      WDBFPO <ndx-filenames>
  59.  
  60. will display any recorded tags. 
  61.  
  62.  
  63. The command:
  64.  
  65.      WDBFPO D:T*.NDX MYDBF
  66.  
  67. tags with the word "MYDBF" all the NDX files on the D: drive with 
  68. filenames that begin with a "T".  The command:
  69.  
  70.      WDBFPO
  71.  
  72. will display the tags (if any) of all NDX files in the default 
  73. subdirectory.
  74.  
  75.  
  76. The program works for both dBASE II and III.  In principle, the tag can 
  77. be any label no more than 11 characters long.  An example of the 
  78. program's output is:
  79.  
  80.  
  81.      Index File      DBF Tag
  82.      --------------  -----------
  83.      CONTRA.NDX      OLLIE      
  84.      ROYALTY.NDX     brooke     
  85.      CONTRIB.NDX     OH_NO      
  86.  
  87.  
  88.  
  89. AND NOW A WORD FROM YOUR SPONSOR
  90. --------------------------------
  91.  
  92. WDBFPO was written in C.  It is small partly because it does not use the 
  93. printf() function.  The program is part of a tutorial on C for dBASE 
  94. programmers in a soon-to-be-published book, "dBASE Power: Creating and
  95. Using Programming Tools."  The book tells you how to write in C and ASM, 
  96. how to write BIN routines, how to create your own dBASE "power" (ugh!) 
  97. tools (and more).
  98.  
  99. The book also tells you how to read a dBASE report format (FRM) file, 
  100. modify it with your text editor, and create an FRM file from DOS.
  101. Naturally, the C programs to do those are in the book. Sounds good?
  102.  
  103. When the book hits the stands, BUY IT. Ok?
  104.  
  105.  
  106.