home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / BASIC / BLTQ121 / !README < prev    next >
Text File  |  1995-01-05  |  29KB  |  598 lines

  1. --------------------------------
  2. Read me first (sharware release)
  3. BULLET v1.2
  4.  
  5. --Documentation (read this before using CZ)
  6.  
  7. The documentation is online in the CZ.COM/CZ.HLP files. To get started just
  8. make sure CZ.HLP is in the current directory and load CZ:
  9.  
  10.    C>cz
  11.  
  12. It can also be loaded high but make sure you have at least 15K of UMB space.
  13. It will load high in as little as 4.5K but will not operate correctly in UMB
  14. without at least 15K. Check out the Using_CZ in the TUTORIAL_INDEX--press
  15. Alt-F1 to hotkey into CZ. Press END (cursor moves to TUTORIAL_INDEX). Press
  16. ENTER. Move the cursor to under Starting_CZ. Press ENTER. Use the END/ENTER
  17. combo to continue until you get the idea. A mouse makes using CZ even easier.
  18.  
  19. If you want to have a hardcopy of the CZ.HLP use the HLP2TXT.EXE program to
  20. strip off the header info. Load it into your favorite WP or text editor.
  21.  
  22. This package is documentation/source-specific to QuickBASIC 4.5 and BASIC 7 in
  23. that much of the source examples deal with using BULLET under these compilers.
  24. Because of this, this version is called BLTQxxx.ZIP.
  25.  
  26.  
  27. --Installation
  28.  
  29. BULLET comes with the BULLET.LIB in compressed form (BULLET.LI_). It must be
  30. installed using the INSTALL.EXE program. INSTALL performs one function: it
  31. decompresses BULLET.LI_ (to BULLET.LIB) and writes installation information
  32. to the BULLET.LIB file. It does nothing else.
  33.  
  34. To install:
  35.  
  36.    C>install
  37.  
  38. The installation process asks two questions and then decompresses the file so
  39. that BULLET.LIB is ready for use. BULLET.LIB is fully-functional and not
  40. crippled. You may use BULLET.LIB and the BULLET package for evaluation only and
  41. for an evaluation period not to exceed 21 days from the date of installation.
  42. BULLET.LIB works with just about every DOS compiler on the market.
  43.  
  44.  
  45. --Registration
  46.  
  47. BULLET is a shareware product. This means that you may try BULLET during the
  48. evaluation period free of obligation. However, you may not use BULLET after
  49. this evaluation period without registering--you must purchase a license to
  50. use BULLET if you wish to continue to use BULLET or any programs produced with
  51. BULLET. See the !ORDER.FRM for ordering information by check, cash, or money
  52. order. Use !ORDER.CC for ordering by credit card.
  53.  
  54.  
  55. --Upgrades and Updates, Site licensing
  56.  
  57. All updates and upgrades are available from the support BBS free-of-charge.
  58. See the PRODUCT_SUPPORT heading under TUTORIAL_INDEX in CZ for more.
  59.  
  60. Site licensing is available at reasonable rates. Contact me for details.
  61.  
  62.  
  63. --Distribution
  64.  
  65. BBS Sysops may carry BULLET on their BBS provided that all files listed in
  66. the !PACKLST file are included in the archive. This file must be provided
  67. free of charge, i.e., this file cannot placed in an area that requires users
  68. to pay a fee for per-file download. A general subscription fee BBS is exempt
  69. from this limitation, provided that no specific charge is assessed to this
  70. particular file.
  71.  
  72. Shareware distributors/catalog vendors may carry BULLET on their inventory
  73. provided that: the BULLET package be the only software on the diskette, that
  74. it be made clear that the purchase of the disk does not constitute purchase
  75. of the product, and that no charge greater than a reasonable amount for
  76. distribution services be charged (for example, not more than 5 dollars).
  77. CD-ROM vendors may include BULLET and may charge more than $5 for the CD,
  78. provided that the CD is not for the sole or primary purpose of distributing
  79. Bullet.
  80.  
  81. Only the shareware version of Bullet may be distributed without explicit
  82. permission from the author.
  83.  
  84. In any case, the author of BULLET may at anytime request (and must be granted)
  85. that the BULLET package be no longer advertised/distributed in the vendors
  86. catalog and that within a reasonable time after request, advertising of BULLET
  87. will end (within 6 months and distribution will end immediately). (Basically,
  88. this means that you as a shareware vendor may include BULLET in your
  89. advertising/distributing but that that I, as the author and owner of BULLET,
  90. have the option of having you stop advertising/distributing BULLET, for
  91. whatever reason (such as it becoming a non-shareware commercial product).)
  92.  
  93.  
  94. --------------------------------------------------------
  95. Status value return code with transaction-based routines
  96.  
  97. The transaction-based routines, InsertXB, UpdateXB, ReindexXB, and all LockXB
  98. routines, do not return the completion status. The return value is the
  99. pack index number that failed. The following example assumes that you are
  100. using multiple index files. If you're not, replace AP(x).y with AP.y.
  101.  
  102.    AP(1).Func = InsertXB   'assume other AP()s setup with .nextPtr
  103.    pid = BULLET(AP(1))
  104.    IF pid = 0 THEN
  105.       IF AP(1).stat = 0 THEN
  106.          'all okay
  107.       ELSE                      'error while adding the data record is returned
  108.          stat = AP(1).stat      'in AP(1).stat if and only if pid=0
  109.          DoErrorWithDataRecord stat
  110.       ENDIF
  111.    ELSE
  112.       stat = AP(pid).stat       'pid is a 1-based value (1...)
  113.       DoErrorWithIndexFile pid, stat
  114.    ENDIF
  115.  
  116. For complete information consult the above named routines in CZ. Note that
  117. ReindexXB does not operate on a data file separately so if its return
  118. code=0 (pid=0) then all operations succeeded. However, with the LockXB
  119. routines, if pid > number_of_packs then the lock on the data file failed.
  120. The following example assumes that a single index file and data file are
  121. to be locked.
  122.  
  123.    packs = 2                    '2 packs (two index files per data file)
  124.    AP(1).Func = LockXB          'assume other AP()s already setup
  125.    pid = BULLET(AP(1))
  126.    IF pid = 0 THEN
  127.       'all okay
  128.    ELSEIF pid <= packs          'error while locking index file and error code
  129.       stat = AP(pid).stat       'in AP(pid).stat
  130.       DoErrorWithIndexFile stat
  131.    ELSE                         'error while locking data file and error code
  132.       stat = AP(2).stat         'also in AP.stat (in last AP pack)
  133.       DoErrorWithDataFile stat  '(i.e., if here then pid=3)
  134.    ENDIF
  135.  
  136.  
  137. ---------------
  138. Troubleshooting
  139.  
  140. Common problems encountered by new users of Bullet are:
  141.  
  142. P: Data fields are skewed, with some fields containing
  143. parts of other fields' data.
  144.  
  145. S: Most of these problems relate to the way C strings are
  146. 0-terminated, while dBASE DBF fields are fixed-length,
  147. and so need not have the \0.  If you are going to use
  148. strcpy, or any other C run-time library that requires
  149. null-terminated strings, then be sure to provide for this
  150. when you define your DBF record.  For example, if you
  151. want two fields, LASTN and FIRSTN, to each have 15
  152. characters, but will be using C strings, define the
  153. fields as 16.  This will allow room for the \0 on your
  154. strings, and give 15 true character places.
  155.  
  156. Often, the case is such that all appears normal when the
  157. DBF file is accessed (i.e., the data fields don't appear
  158. to be skewed), but indexed access is not correct.  This
  159. is because your program code has templated the data
  160. record consistent with what was written (and is read) at
  161. the DBF level.  However, it is not consistent with the
  162. DBF header specifications (written in CreateDXB) and so
  163. any external access to the DBF (including Bullet keyed
  164. access) will not be correct.
  165.  
  166. Skewed data also results when you change either your
  167. program's data structure template of the DBF record, or
  168. your DBF field list definitions, but don't do the same to
  169. both.  The physical record buffer in your program must
  170. exactly match that of the DBF record.  Off the subject a
  171. bit, but possibly on your mind:  yes, you can create all
  172. this on the fly (i.e., not hard-coded fieldnames, etc.),
  173. but it does require that you manage all offsets yourself,
  174. rather than have the compiler do it for you.  A job for a
  175. C++ wrapper, I suppose.  Certainly do'able as I''ve done
  176. it using a BASIC compiler (see IDEMO.*)
  177.  
  178. Another reason for skewed fields is that the compiler is
  179. modifying the alignment of your program's DBF record
  180. structure.  It is imperative that you instruct your
  181. compiler to not modify any Bullet-used structure:
  182. #pragma pack() is used by many compilers.  Consult your
  183. compiler documentation.  For non-Bullet structures,
  184. alignment doesn't matter to Bullet.  Bullet structures
  185. are any of the Bullet packs, and any DBF record
  186. template/buffer/structure that your program uses to
  187. communicate with Bullet.
  188.  
  189. The main point is to ensure that your physical data
  190. record (structure) you use in your C/C++ program exactly
  191. matches, field for field, that of the DBF record on disk.
  192.  
  193.  
  194. P: Error 240 occurs when attempting to index or reindex
  195. when all else seems to be right.
  196.  
  197. S: dBASE specifications require that fieldnames of the
  198. DBF be 0-filled.  Some programs create DBF files that do
  199. adhear to this specification, but instead just null-
  200. terminate the fieldname.  These files must be fixed
  201. before they can be used by Bullet.  When creating Bullet
  202. DBF files, you must 0-fill the fieldnames (11 bytes, 10
  203. bytes data -- byte 11 always=0).  Memset() can be used to
  204. quickly 0-fill the entire fieldlist.
  205.  
  206.  
  207. P: Find an exact match on a GetEqualXB.
  208.  
  209. S: The problem usually stems from index files created to
  210. allow non-unique keys.  Personally, I don't create index
  211. files where the primary key is not unique, but the demand
  212. was there and so Bullet provides for this.  However,
  213. since there's no real way to offer indexing on physically
  214. indentical keys, Bullet adds an enumerator word at the
  215. end of each key (only if the index file is not using
  216. unique keys).  This two enumerator is in high byte/low
  217. byte order, and is incremented for each duplicate key in
  218. the index file.  For example, if KINGM is added as a key,
  219. and is found to be the first such key by Bullet, the
  220. actual physical key is KINGM\0\0, where the enumerator is
  221. the last two bytes (in Motorola-word order for proper
  222. collating).  Upon the next insert of a "KINGM" key,
  223. Bullet uses KINGM\0\1.  And so on.
  224.  
  225. To search for this key, which by the way is 7 bytes long,
  226. and so reported by StatKXB, though logically it is only
  227. the 5 bytes (as in strcpy(keyExp,"SUBSTR(LASTN,1,5)")
  228. with non-unique keys permitted), you must account for
  229. this in your keybuffer.  For example, in your global
  230. scratch keybuffer (or you can use a separate buffer for
  231. each index file, up to you)  you must specify all 7
  232. bytes, not just the first 5.  This because the data at
  233. bytes 6/7 may not equal \0\0 or \0\1, and so these keys
  234. will not be found (error 201).  In this particular case,
  235. where duplicate keys exist, and you want to locate a
  236. KINGM record, you really have no choice but to start with
  237. strcpy(keybuff,"KINGM\0\0", be aware of the "extra" \0
  238. put by the strcpy function) and GetEqualXB, check the
  239. data record returned, and if not the one wanted, do
  240. GetNextXB until the desired record is located (or not).
  241. Alternatively, you could specify "KINGM\255\255" and use
  242. GetEqualXB followed immediately by GetPrevXB (enumerator
  243. \255\255 is the very last possible, and so will never be
  244. found, but will setup the internal gears so that the
  245. GetPrevXB will locate the very last existing "KINGM??").
  246.  
  247.  
  248. All this is really only a concern if you permit duplicate
  249. keys.  The above could be made unique by adding expanding
  250. the key expression.  For example, a key based on
  251. SUBSTR(LNAME,1,5)+SUBSTR(SSN,6,4) would be pretty unique
  252. (first 5 characters of last name followed by last 4 SSN
  253. numbers (used as characters)).
  254.  
  255.  
  256. Q: How do I specify the key I want to find?
  257.  
  258. A:  The keybuffer (AP.keybuffptr locating it) is filled
  259. with whatever data type you want to locate (hence,
  260. keybuffer is of void type).  If you want to locate a
  261. character key, simply specify the key, such as
  262. strcpy(keybuffer,"whatever") (see "Find an exact match on
  263. GetEqualXB", above).  If you are locating a binary key
  264. value, place the binary value, with the appropriate cast,
  265. into the keybuffer: e.g., *((long *)keybuffer) = 5L;.
  266.  
  267.  
  268. These problems are the most frequently expressed to me.
  269. If you are having other problems related to getting
  270. Bullet going, feel free to contact me at the locations
  271. listed under Product Support.  My ability to quickly
  272. respond to your requests is directly related to how
  273. thorough you are in expressing the exact cicumstances of
  274. any problem.
  275.  
  276. Complete sample programs are in short supply.
  277. Experienced C or C++ programmers that would like their
  278. "Bullet wrappers" possibly included in future releases
  279. are requested to contact me.  Additional samples will be
  280. made available on the BBS, available to all.  Of course,
  281. registered Bullet users will have access to the best of
  282. the best, and always have free access to the current
  283. versions of Bullet.
  284.  
  285. When you've done everything and it's still not working,
  286. it's time to read the documentation!
  287.  
  288. -------------------
  289. Questions & Answers
  290.  
  291. Q: What is BULLET?
  292.  
  293. A: BULLET is a library of program modules that together let the programmer
  294.    develop and create software that can manage huge amounts of data on
  295.    disk using the industry-standard DBF data file format. It also uses high-
  296.    speed b-tree index files to manage keyed data file access.
  297.  
  298.  
  299. Q: What compiler is BULLET for?
  300.  
  301. A: BULLET can be used by nearly all DOS compilers. It's written entirely in
  302.    assembly language. Because of this, it does not require any particular
  303.    programming language or compiler vendor. The 4 requirements are listed
  304.    in the !WHATIS.TXT file.
  305.  
  306.  
  307. Q: Why do I need BULLET when all I need to handle are small amounts of data?
  308.  
  309. A: BULLET can deal with a database as small as 1 record or as large as several
  310.    million. While your current needs may be small, your future needs are bound
  311.    to expand. BULLET can work with you now, and later, even if you switch
  312.    development platforms by moving to another compiler. And BULLET is fast,
  313.    it can deal with a database with millions of records as easily as it can
  314.    with just a few.
  315.  
  316.  
  317. Q: But b-tree stuff, isn't that hard?
  318.  
  319. A: Everything associated with maintaining the database, its data files and its
  320.    index files, is done behind-the-scenes by BULLET. You just specify how the
  321.    data record is to look by specifying the number of fields, their lengths and
  322.    types, and then specify how you want your index files to be based.
  323.  
  324.  
  325. Q: So how do I design my data record?
  326.  
  327. A: You probably have a pretty good idea, already. A good way to determine what
  328.    should go into a database is what you want to come out of it. For example,
  329.    if you're doing a mailing list program, you'll want to have at least the
  330.    name, perhaps broken into first name and last. Also you'll need the mailing
  331.    address--4 lines is usually enough, so you'll want 4 separate address line
  332.    fields. Then there's the State and ZIP, possibly even country. That's the
  333.    minimum. It would look something like this:
  334.  
  335.    FIRSTNAME field of 15 characters; LASTNAME field of 19 characters; ADDR1
  336.    field of 34 characters, ADDR2, ADDR3, ADDR4 as ADDR1; State field of 2
  337.    characters, and ZIP a field of 5 (or 9 if ZIP+4) characters. You could
  338.    specify the ZIP as a numeric field if you wanted.
  339.  
  340.    You'll notice that the longest field is 34 characters. Why? Because most
  341.    mailing labels are 3.5 inches, about 34 characters across. Since the first
  342.    name and last are usually put on the same line, their total should be 34.
  343.  
  344.    You'll probably want to add more fields like telephone number, last time
  345.    written to, oh, just about anything that you'd think would be important to
  346.    know. There you go, you've just designed your data record.
  347.  
  348.  
  349. Q: Then what?
  350.  
  351. A: Then decide how you need to access this data. You'll want to access it at
  352.    least by name, so one index you'll want is on the name. While you could
  353.    specify the entire name be used as a key, say LASTNAME+FIRSTNAME, this is
  354.    a bit of overkill. Instead, you may want to use just a portion of the name.
  355.    A good candidate would be SUBSTR(LASTNAME,1,5)+SUBSTR(FIRSTNAME,1,1). This
  356.    sets up a key that's only 6 bytes long. The first method, using all the
  357.    name, would be 34 bytes long. By keeping your keys short you'll keep your
  358.    index files small and your index performance high. And yes, you can also
  359.    mix numeric field types with character field types in your key expressions.
  360.  
  361.  
  362. Q: But what if I have two or more names that are identical, or very similar
  363.    but have these parts of the names the same?
  364.  
  365. A: BULLET lets you specify if your index files allow only unique key entries or
  366.    whether duplicate keys are permitted. When keying on a name you should have
  367.    your index file allow duplicate keys. What BULLET does is number these
  368.    identical keys by adding a suffix to each key (called an enumerator). This
  369.    enumerator allows the index algorithm to treat each key as a different key.
  370.    If you search the index for all matches in the first 6 characters of the
  371.    key (the enumerators will always be different) these similar names will
  372.    be found in consecutive order. To find out if the key you've just accessed
  373.    is the actual person you had in mind, you'd scan the data record associated
  374.    with that key for other information, such as middle initial, address,
  375.    anything that would make that person recognizable from another with a
  376.    similar key. If it isn't what you're looking for, get the next key and data
  377.    record, and so on until the first 6 characters of the key no longer are the
  378.    6 you're looking for.
  379.  
  380.  
  381. Q: So I've got my data record designed and also my primary index file. What
  382.    else should I do?
  383.  
  384. A: Now that the database is designed most of the "unknown" is taken care of.
  385.    What comes next depends on how you, yourself, program. What I often do
  386.    next is detail exactly what I want the output to be. That way, I've got
  387.    the front and the back and just need to do the middle. The middle is where
  388.    the fun's at. You'll be amazed at just how few of your in-the-middle coding
  389.    is spent on managing the database. BULLET takes care of all the little
  390.    details. You just need to give it the data and tell it what to do with
  391.    it. Or you tell it what to get and it comes back with what you requested.
  392.    You then do whatever you want with that data.
  393.  
  394.  
  395. Q: I've looked at the header file and it sure has a lot of commands. You're
  396.    telling me that this is simple?
  397.  
  398. A: Yes. Once you've created your data and index files, those mid-level
  399.    routines are not often used. Almost everything you do in your in-the-middle
  400.    coding will use the high-level routines. The InsertXB and UpdateXB routines
  401.    handle adding new or changing existing data, and the GetFirstXB, GetNextXB,
  402.    etc., routines handle getting the data. 90% of the time these are the
  403.    routines your program will be using.
  404.  
  405.  
  406. Q: What about all those packs? How can I keep them straight?
  407.  
  408. A: The good thing about modern programming langauges is that they let you
  409.    build reusable code. The ideal way to use BULLET is to build reusable
  410.    code objects in your programming langauge of choice and hide the down-and-
  411.    dirty aspects of dealing with the various packs in those objects. For
  412.    example, a create key routine could be written once and that object used
  413.    for all your other programming projects:
  414.  
  415.       DECLARE FUNCTION CreateNewIndex% (filen$, kx$, kflags%, XBlink%)
  416.  
  417.       FUNCTION CreateNewIndex(filename$, kx$, keyflags, XBlink)
  418.  
  419.       DIM CKP AS CreateKeyPack
  420.       DIM TmpFile AS STRING * 80
  421.       DIM TmpExp AS STRING * 136
  422.  
  423.       TmpFile = filename$ + CHR$(0)
  424.       TmpExp = kx$ + CHR$(0)
  425.  
  426.       CKP.Func = CreateKXB
  427.       CKP.FilenamePtrOff = VARPTR(TmpFile)
  428.       CKP.FilenamePtrSeg = VARSEG(TmpFile)
  429.       CKP.KeyExpPtrOff = VARPTR(TmpExp)
  430.       CKP.KeyExpPtrSeg = VARSEG(TmpExp)
  431.       CKP.XBlink = XBlink
  432.       CKP.keyflags = keyflags
  433.       CKP.CodePageID = -1
  434.       CKP.CountryCode = -1
  435.       CKP.CollatePtrOff = 0
  436.       CKP.CollatePtrSeg = 0
  437.       stat = BULLET(CKP)
  438.       CreateNewIndex = stat
  439.  
  440.       END FUNCTION
  441.  
  442.    The TmpFile and TmpExp were used in this QuickBASIC example so that the
  443.    string data is assigned to a fixed-length string. VARSEG/VARPTR operate
  444.    on fixed-length strings identically in both BASIC 7 and QuickBASIC 4.5.
  445.    If you want to forgo this compatibility you could use a var-len string
  446.    and the BASIC SADD() function instead of VARPTR. I find using the
  447.    temporary fixed-length strings just as easy since a CHR$(0) needs to
  448.    be appended to the string in any case. And they are temporary strings--
  449.    as soon as the CreateNewIndex() routine exits, the memory assigned to the
  450.    Tmp strings is released.
  451.  
  452.    So, once you write this create index object, you can reuse it over and
  453.    over again without needing to recode it every time. Just a simple
  454.  
  455.    stat = CreateNewIndex(filename$,keyexpression$,keyflags,XBlink)
  456.  
  457.    is all you need to put in your in-the-middle code. Oh, the key expression,
  458.    keyflags, and XBlink are all explained under CreateKXB in CZ.
  459.  
  460.  
  461. Q: I think I'm getting the hang of it. What's next?
  462.  
  463. A: Jump in and start coding. You may want to look over, maybe even print out,
  464.    one of the example programs. The BB_CAI10.BAS is straight forward, try
  465.    that. If you have any questions, just pop-up CZ. It's all in there.
  466.  
  467.  
  468. Q: Sounds good. But, tell me, what is the first thing I'm likely to muff?
  469.  
  470. A: Nothing serious. Just make sure that your record structure in memory
  471.    reserves the first byte for the delete tag. Also, make sure that the field
  472.    descriptors you assigned when you created the data file match your in-memory
  473.    structure, i.e., if you've created a data file (using CreateDXB) with say, 3
  474.    fields, each 25 characters long, make sure that your in-memory structure is
  475.    also 3 fields, each 25 characters:
  476.  
  477.       TYPE ExampleRecordTYPE
  478.       tag AS STRING * 1
  479.       Field1 AS STRING * 25
  480.       Field2 AS STRING * 25
  481.       Field3 AS STRING * 25
  482.       END TYPE
  483.  
  484.    Note: it is allowable to alias your physical fields but the total length
  485.    must match the total length of the DBF data record. (Alias meaning that
  486.    instead of using Field1 AS STRING * 25, you use Field1a AS STRING 13 and
  487.    Field1b AS STRING 12. Be sure you know what you're doing!--the IDEMO.BAS
  488.    program uses this technique (not in the strict sense of alias) by using a
  489.    single 4000-byte in-memory record since it can't know beforehand what
  490.    structure a random DBF file has.)
  491.  
  492.    Also, the transaction routines (InsertXB, UpdateXB, ReindexXB, and the
  493.    LockXBs) return a transaction index rather than a completion code. Be sure
  494.    to check the documentation for the routines.
  495.  
  496. Q: I'm off.
  497.  
  498. A: So am I, but be sure to...
  499.  
  500.    ...Read the manual! Until you do you can't take full advantage of BULLET.
  501.  
  502.  
  503. ---------------
  504. What is BULLET?
  505.  
  506. If you've been wanting to create the ultimate database program, or just a simple
  507. mailing list to handle your holiday cards, BULLET is the programming library for
  508. you. BULLET is a library module for programmers developing in MS-DOS. What
  509. language you ask? Would you believe most any? That's right, BULLET is designed
  510. to operate as-is with most compilers* available for DOS (DOS 3.3 or above is
  511. required). This is possible because BULLET is written entirely in assembly
  512. langauge. Everything it needs it has built in, so no specific compiler run-time
  513. library is required. Your compiler simply needs to be able to:
  514.  
  515.  1. Perform a far call to an external routine using the Pascal calling
  516.     convention.
  517.  2. Build a parameter pack, as in a C struct or BASIC TYPE, for example.
  518.  3. Pass a single far pointer by value (of the parameter pack) to the external
  519.     routine.
  520.  4. Accept a return integer value from the external routine (optional).
  521.  
  522. BULLET uses high-speed b-tree indexes and the industry-standard DBF data file
  523. format to quickly and easily move data to and from disk. The BULLET API includes
  524. over 65 functions to perform tasks from low-level direct DOS file I/O to
  525. high-level transaction-based updates to network routines that let you control
  526. who has access to your files and when. National Language Support (NLS) is built
  527. into each key file. This allows you to properly sort mixed-case and/or foreign
  528. language alphabets. BULLET supports character keys up to 64 bytes as well as
  529. 16-/32-bit integer keys (signed or unsigned). Index files specify if duplicate
  530. keys are allowed or whether unique keys are to be enforced. And although dBASE
  531. DBF data file compatiblility is standard, you can create non-standard DBF files,
  532. such as having fields contain binary data. Key expressions are specified using
  533. text, as in kx = "SUBSTR(Fieldname,1,10)+Fieldname+SUBSTR(Fieldname,10,3)". Keys
  534. may be composed of up to 16 separate fields, located anywhere within the record.
  535.  
  536. The transaction nature of BULLET greatly simplifies what is required of the
  537. programmer. For example, let's say you have a 100,000-record data file with 12
  538. active index files and need to insert a new record. With BULLET, you simply
  539. build the data record and call the InsertXB routine. InsertXB adds the record to
  540. the data file, builds all 12 keys and inserts each into the appropriate index
  541. file. If an error occured, say, while inserting the 11th key, BULLET
  542. automatically backs-out all changes just made to the key files and data file. As
  543. another example, say, updating an exisiting data record, you'd make any
  544. modifications to the data record and call the UpdateXB routine. UpdateXB updates
  545. the record in the data file and automatically updates all 12 index files. If an
  546. error occured, say, with the 5th key, BULLET automatically backs-out all changes
  547. made to the key files and data file.  In addition, transaction-based network
  548. routines are available. These high-level lock/unlock routines also automatically
  549. handle the necessary reloading and flushing of file headers. And what  about
  550. performance? Read on.
  551.  
  552.  
  553. BULLET is fast! The ReindexXB routine indexes your DBF data files in no time
  554. flat: that 100,000 record .DBF can be completely reindexed in under 30 seconds
  555. on a fast computer system. The InsertXB routine can add 1,000 new records and
  556. keys to that 100,000 record database at a rate of over 50 new inserts per
  557. second. This isn't inserting into an empty database, it's inserting into a
  558. database that's already 100,000 records large. UpdateXB can update
  559. 1,000 records in that database at a rate of 20 updates/second. And what about
  560. access speed? How fast can you get to your data once it's in the database? Real
  561. fast! To access from first key to last all 100,000 keys takes less than
  562. 25 seconds (4500+/sec). That shows how fast you can find keys. To access the
  563. keys and also access each data record associated with that key takes a bit
  564. longer. Accessing all 100,000 keys and records takes just over a minute
  565. (1400+/sec). This is in-order access. Incredible. And if you wanted to access
  566. from the last key to the first (reverse-order), the times are just as fast.
  567. What do you get with the BULLET package?
  568.  
  569.  - The BULLET library module, 19K of code and static data space (small indeed)
  570.  - Sample programs in BASIC and C plus an interactive demo for browsing any DBF
  571.  - QuickBASIC .bi include and C .h header files
  572.  - Over 200K of documentation, source examples, and a tutorial, all online
  573.  - CZ, the 15K online, context-sensitive, hyper-text help manager
  574.  - Royalty-free use of BULLET in your programs
  575.  
  576. Routines by category:
  577.  
  578. SYSTEM: InitXB, ExitXB, AtExitXB, MemoryXB, BreakXB, BackupFileXB, StatHandleXB,
  579. GetExtErrorXB
  580.  
  581. MID-LEVEL RECORD/KEY ACCESS: CreateDXB, OpenDXB, CloseDXB, StatDXB, ReadDHXB,
  582. FlushDHXB, CopyDHXB, ZapDHXB, CreateKXB, OpenKXB, CloseKXB, StatKXB, ReadKHXB,
  583. FlushKHXB, CopyKHXB, ZapKHXB, GetDescriptorXB, GetRecordXB, AddRecordXB,
  584. UpdateRecordXB, DeleteRecordXB, UndeleteRecordXB, PackRecordsXB, FirstKeyXB,
  585. EqualKeyXB, NextKeyXB, PrevKeyXB, LastKeyXB, StoreKeyXB, DeleteKeyXB,
  586. BuildKeyXB, CurrentKeyXB
  587.  
  588. HIGH-LEVEL ACCESS: GetFirstXB, GetEqualXB, GetNextXB, GetPrevXB, GetLastXB,
  589. InsertXB, UpdateXB, ReindexXB
  590.  
  591. NETWORK: LockXB, UnlockXB, LockKeyXB, UnlockKeyXB, LockDataXB, UnlockDataXB,
  592. DriveRemoteXB, FileRemoteXB, SetRetriesXB
  593.  
  594. LOW-LEVEL DOS ACCESS: DeleteFileDOS, RenameFileDOS, CreateFileDOS,
  595. AccessFileDOS, OpenFileDOS, SeekFileDOS, ReadFileDOS, ExpandFileDOS,
  596. WriteFileDOS, CloseFileDOS, MakeDirDOS
  597.  
  598.