home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / bit / listserv / dbasel / 1168 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  1.6 KB

  1. Xref: sparky bit.listserv.dbase-l:1168 comp.databases:7745
  2. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!neoucom.edu!aldhfn!saxon!fletcher
  3. From: fletcher@saxon.UUCP (Edward F Eaglehouse)
  4. Subject: Re: Clipper 5.01 dbcreateindex() problem
  5. Newsgroups: bit.listserv.dbase-l,comp.databases
  6. References: <1d6ua3INNk4d@mizar.usc.edu>
  7. X-Newsreader: TIN [version 1.1 PL6]
  8. Message-ID: <fletcher.026b@saxon.UUCP>
  9. Date: 7 Nov 92 22:02:49 EST
  10. Organization: Auldhaefen Associates
  11. Lines: 21
  12.  
  13. The problem I have found is that the expression and the code block MUST
  14. MATCH EXACTLY, else dbcreateindex() calls the function once, sees that they
  15. don't match, and promptly aborts.
  16.  
  17. There was an article in Data Based Advisor in the Clipper column by Rick
  18. Spence that addressed this issue.  It is also in the reference book "Clipper
  19. Programming Guide, 3rd Edition, Version 5.01" by Rick Spence (a nice book to
  20. keep on your shelf).  For anyone interested in picking this up, it is
  21. published by Microtrend Books (Slawson Communications, Inc.).
  22. ISBN 0-915391-68-6.
  23.  
  24. Basically what you do is add a UDF to your key expression that displays your
  25. progress bar (RECNO() / LASTREC() * 100.0 gives a percentage).  When the
  26. indexing is complete, use the low-level file functions to read the indexing
  27. expression from the index file (close it first), remove the UDF at the end
  28. of the key expression, and rewrite it.  The expression starts at offset 22
  29. (23rd byte) in the NTX file and is a maximum length of 256; the expression
  30. is terminated with a null byte.
  31.  
  32. Note that the indexing expression is always called once with RECNO() at EOF
  33. before indexing actually starts.
  34.