home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / BASIC / LIBWIZ14 / LIBWIZ.DOC < prev    next >
Text File  |  1992-11-22  |  17KB  |  408 lines

  1.          The Library Wizard's *BASIC Library Manager*    page 1
  2.          =------------------------------------------=
  3.                           Version 1.4
  4.  
  5.      LIBWIZ  Copyright (c) 1991-1992  Thomas G. Hanlin III
  6.  
  7.  
  8.  
  9. This is LIBWIZ, a collection of utilities for managing BASIC
  10. libraries.  It allows you to customize your libraries,
  11. selecting just the routines you want. As well as creating new
  12. libraries, LibWiz creates corresponding "include" files and
  13. (optionally) quick references of the routines in the library.
  14.  
  15. LibWiz requires a special description file to work with a
  16. library.  My own libraries come complete with description files
  17. (BASWIZ as of v1.5, PBClone as of v1.4).  The LibWizU utility
  18. assists in creating description files for libraries which don't
  19. have them.  The UnLib utility allows you to extract all .OBJ
  20. files from a .LIB, since LibWiz needs to work with the .OBJs
  21. directly.
  22.  
  23. The LIBWIZ collection is copyrighted and may be distributed
  24. only as long as all files are distributed together, with no
  25. added or deleted files.  The files may not be altered in any
  26. way.  Exceptions to these rules may be made at my discretion,
  27. but you must get written permission from me in advance.
  28.  
  29. You use these utilities at your own risk.  They have been
  30. tested by me on my own computer, but I will not assume any
  31. responsibility for any problems which they may cause you.  If
  32. you do encounter a problem, please let me know about it, and I
  33. will do my best to verify and repair the error.
  34.  
  35.                        Table of Contents                 page 2
  36.  
  37.  
  38.  
  39.  Overview and Legal Info .................................. 1
  40.  
  41.  The LIBWIZ Library Manager ............................... 3
  42.  
  43.  The LIBWIZU .INF Maker ................................... 6
  44.  
  45.  Updating Libraries with UPDLIB ........................... 7
  46.  
  47.  Merging Libraries ........................................ 8
  48.  
  49.  Portability Notes ........................................ 9
  50.  
  51.  Miscellaneous ........................................... 10
  52.  
  53.                   The LIBWIZ Library Manager             page 3
  54.  
  55.  
  56.  
  57. A library is a collection of routines, or partial programs,
  58. which can be used directly as if they were part of the language
  59. itself.  A library may be considered as a language extender.
  60. Since library routines can be written in a variety of
  61. languages, they may provide capabilities that are impossible
  62. using the target language alone.  Even if the routines do
  63. something that is within the capabilities of the target
  64. language, they are valuable in that they are already tested and
  65. provide a standardized approach to whatever they do.  The
  66. flexibility of libraries is a part of their power... and a
  67. problem!
  68.  
  69. The sheer number and variety of libraries available for BASIC
  70. is staggering. Many libraries contain hundreds of different
  71. routines of all descriptions. Sifting out just the routines you
  72. need is a hassle.  It's rarely practical to combine entire
  73. libraries, either due the presence of routines by the same name
  74. in different libraries or simply due to memory limitations.  In
  75. fact, my shareware libraries BasWiz and PBClone have each grown
  76. too large for BASIC to deal with comfortably.
  77.  
  78. LibWiz provides a solution.  It allows you to choose just the
  79. routines you want from a library, either individually or by
  80. category.  It resolves any interdependencies to make sure the
  81. library contains all the routines it needs to function.  As
  82. well as customizing the library itself, LibWiz creates new
  83. "quick reference" and "include" files.
  84.  
  85. In order to do its stuff, LibWiz needs a ".INF" file which
  86. tells it about the library to be customized.  Appropriate files
  87. are included with the current versions of my own libraries.
  88. The LibWizU utility can be used to create .INF files for other
  89. libraries.  Aside from the .INF file, LibWiz needs to have
  90. access to all of the .OBJ files that make up the library.  If
  91. your library didn't come with the separate .OBJ files, you can
  92. extract them from the .LIB using UNLIB.EXE:
  93.  
  94.    UNLIB LibName
  95.  
  96.                   The LIBWIZ Library Manager             page 4
  97.  
  98.  
  99.  
  100. To use LibWiz, move to the directory which holds the .OBJ files
  101. and the .INF file for the library you wish to customize.  The
  102. syntax is:
  103.  
  104.    LIBWIZ InfName LibName
  105.  
  106. ...where "InfName" is the name of the .INF file and "LibName"
  107. is the name of the desired .LIB library.  All files (except for
  108. LibWiz itself) must be in the same drive and directory.
  109.  
  110. The option "/B" can be used to force a monochrome display,
  111. although LibWiz normally detects mono displays by itself.
  112.  
  113. If you would like LibWiz to create a quick reference listing of
  114. the routines in the library, add "/R" to the command.
  115.  
  116. I don't -think- any further instructions are needed, as picking
  117. the routines is a fairly simple process-- give it a go.
  118.  
  119. When you are done, provided that you told LibWiz to go ahead
  120. and create a library, it will create a number of files: an
  121. "include" (.BI) file, a revised library info (.INF) file, and a
  122. library (.LIB) file, at a minimum.  If you specified /R, a
  123. quick reference (.REF) file will also be created.  LibWiz can
  124. also create a quick library (.QLB) file, but you must set an
  125. environment variable to tell it which QLB support library to
  126. use.  This is BQLB40 or BQLB41 for QuickBASIC 4.0 versions,
  127. BQLB45 for QuickBASIC 4.5, QBXQLB for BASCOM/PDS, and VBDOSQLB
  128. for Visual Basic for DOS.  The variable name is QLBNAME.  So,
  129. to have LibWiz create a .QLB for QuickBASIC 4.5, for example,
  130. you'd put this in your AUTOEXEC.BAT:
  131.  
  132.    SET QLBNAME=BQLB45
  133.  
  134. The files LibWiz generates will all start with the name you
  135. specified as the "LibName" command-line parameter.
  136.  
  137. If LibWiz is unable to create a library, it will tell you so.
  138. In that case, the LIB response file (LIBWIZ$$.TMP) will be left
  139. on the disk instead of being deleted.  You can try the LIB
  140. command yourself at the command line, and the resulting error
  141. message(s) will give you some idea of what went wrong:
  142.  
  143.    LIB @LIBWIZ$$.TMP
  144.  
  145. In the case that a .QLB wasn't generated, chances are that you
  146. have an old version of LINK in your path, or the LIB
  147. environment variable wasn't set to tell LINK where to find the
  148. QLB support library.  You can find out by trying to create the
  149. .QLB yourself at the command line:
  150.  
  151.    LINK libname.LIB/Q/SE:1024,libname.QLB,NUL,BQLB45;
  152. (use the appropriate QLB support library where it says BQLB45)
  153.  
  154.                   The LIBWIZ Library Manager             page 5
  155.  
  156.  
  157.  
  158. At the moment, LibWiz can handle up to 1,023 routines per
  159. library; up to 4 categories per routine; up to 255 categories
  160. total.
  161.  
  162. If you are processing a large library, have patience!  LibWiz
  163. has a lot of work to do and may take a while to read and write
  164. all the files for a big library.  Don't panic!
  165.  
  166.  
  167.  
  168. A few cautions on common problems with LINK:
  169.  
  170.   If you get back a message like "/Q switch not recognized",
  171.   you have an old version of LINK somewhere in your path.  You
  172.   must use the LINK that came with your QuickBASIC, BASCOM/PDS,
  173.   or VB-DOS compiler to create the .QLB-- older versions of
  174.   LINK don't know what a .QLB is.  You may think you don't have
  175.   an old version of LINK, but if that's the error message,
  176.   there's an old LINK somewhere on your drive!
  177.  
  178.   If you get back a message like "BQLB45 not found", you don't
  179.   have your LIB environment variable set to point to your BASIC
  180.   library area.  The LIB variable works kind of like PATH, but
  181.   it tells the computer where your .LIB files are located.
  182.   Include a SET LIB line in your AUTOEXEC.BAT, and you won't
  183.   have to worry about it again.  That might look something like
  184.   this, assuming your .LIB files are in C:\QB45\LIB:
  185.  
  186.      SET LIB=C:\QB45\LIB
  187.  
  188.                     The LIBWIZU .INF Maker               page 6
  189.  
  190.  
  191.  
  192. The LibWiz library manager requires an .INF file to tell it
  193. about a library. This file specifies routine names, categories,
  194. object modules, declarations and descriptions.  If you don't
  195. have an .INF file for your library, the LibWizU utility will
  196. handle much of the work of creating it for you.
  197.  
  198. To use LibWizU, move to the directory which holds the .OBJ
  199. files and .BI (declaration) file for your library.  Type:
  200.  
  201.    LIBWIZU LibName
  202.  
  203. ...where LibName is the name of the .BI file.  After chugging
  204. through the declaration and object files, LibWizU will create
  205. an .INF file for the library.  It will also report on Public
  206. routines (routines listed in the declaration file, which are
  207. evidently intended for public use), Private routines (routines
  208. which can be accessed but are not in the declaration file and
  209. are assumed to be private for use only by the public routines),
  210. and Orphans. Private routines will not be shown by LibWiz, but
  211. will be pulled into a library if needed by a public routine
  212. that was selected. Orphans are routines which are listed in the
  213. declaration file but which do not appear in the object files.
  214. If there are any orphans, ORPHAN.LST will contain their names.
  215.  
  216. The .INF file created by LibWizU is not complete.  You must
  217. fill it in using a text editor.  A description for each routine
  218. is a good idea, though not strictly mandatory.  A description
  219. may be no longer than 70 characters.  Each routine must be in
  220. at least one category or it is assumed to be private.  A
  221. category can be as many as 16 characters.  A routine may be in
  222. up to four categories (list them on the same line, separated by
  223. spaces).
  224.  
  225. Here's a sample entry for a routine (taken from PBCLONE.INF):
  226.  
  227. Name: CLOCK
  228. Mod : CLOCK.OBJ
  229. Decl: DECLARE SUB Clock (BYVAL DisplayOn%)
  230. Type: Display Time
  231. Desc: Keep a clock displayed on the screen
  232.  
  233. The entries are created in this order by default, but may be in
  234. any order as long as the "Name:" definition is first.  If you
  235. would like to enter comments into the file, use "Note:".  Such
  236. notes will be ignored by LibWiz.
  237.  
  238. If you need information in the .BI file other than just
  239. DECLAREs, such as perhaps TYPE definitions, DEFINT or other
  240. statements, you must create an additional file with an .HDR
  241. (header) extension.  If LibWiz detects the file InfName.HDR, it
  242. will copy that file to LibName.HDR and "REM $INCLUDE" it in
  243. LibName.BI before the DECLAREs for the library.
  244.  
  245.                 Updating Libraries with UPDLIB           page 7
  246.  
  247.  
  248.  
  249. One of the problems associated with creating custom libraries
  250. is keeping them up to date.  The UPDLIB utility will handle
  251. such updates automatically without any need for you to rebuild
  252. your custom libraries from scratch.  Simply place the new .OBJ
  253. files in a single directory (use UNLIB to extract them if they
  254. are in a library themselves).  Tell UPDLIB which library to
  255. update:
  256.  
  257.    UPDLIB mylib
  258.  
  259. The UPDLIB utility will scan this library, and if a module
  260. exists both in the library and in the current directory, it
  261. will replace the version in the library with the one on disk.
  262.  
  263. Note that UPDLIB works entirely based on the module name, which
  264. is the same as the file name in the case of the .OBJ file.  If
  265. the file name changes from one version of the base library to
  266. another, UPDLIB can't help you-- it's not omniscient.  However,
  267. it will handle the usual case fully automatically, saving you a
  268. great deal of effort.
  269.  
  270.                        Merging Libraries                 page 8
  271.  
  272.  
  273.  
  274. In order to combine two libraries, you must have both libraries
  275. in .LIB form.  A new, combined .LIB can be created with the
  276. LIB.EXE utility that comes with BASIC:
  277.  
  278.    LIB NewLib,+LibOne.LIB+LibTwo.LIB;
  279.  
  280. A combined .QLB can be created using LINK:
  281.  
  282.    LINK LibOne.LIB+LibTwo.LIB/Q/SE:1024,NewLib.QLB,NUL,BQLB45;
  283.  
  284. As noted earlier, you may need to use a different name than
  285. "BQLB45".  If you have QuickBASIC 4.0, it will be either
  286. "BQLB40" or "BQLB41".  If you have BASCOM/PDS ("Professional
  287. Development System"), it will be "QBXQLB".  For VB-DOS, it's
  288. "VBDOSQLB".
  289.  
  290. The /SE option is used to tell LINK it may have to deal with a
  291. lot more routines than it expected by default.  If you get an
  292. overflow error, there are too many routines to fit into the
  293. .QLB library.  Try a larger /SE, or take some routines out.
  294.  
  295. If both libraries have a routine by the same name, there will
  296. be a conflict. You can fix this by changing the name of the
  297. routine in one of the libraries. My ObjTool utility (available
  298. elsewhere) allows you to do this.
  299.  
  300. ObjTool, like LibWiz and LibWizU, expects to deal with .OBJ
  301. files rather than with .LIB or .QLB files.  If you only have a
  302. .QLB library, there's nothing you can do about this.  If you
  303. have a .LIB library, however, you can use the LIB.EXE utility
  304. to remove .OBJ files from the library (or use UNLIB.EXE).
  305.  
  306. When LIB gives you the "Operations" prompt, use:
  307.  
  308.    *ObjName     to copy an .OBJ file from the lib to your disk
  309.    -ObjName     to delete an .OBJ from the library
  310.    +ObjName     to add an .OBJ to the library
  311.    -+ObjName    to update an .OBJ in the lib from your disk
  312.  
  313. If you don't know the names of the .OBJ modules, ask LIB.  Just
  314. press <enter> when it asks for Operations, then give it the
  315. name of a file when it prompts for a "List file".  The
  316. resulting file will contain a list of the modules in the
  317. library and what routines are in each module.
  318.  
  319. When combining libraries, don't forget to combine their .INF
  320. files as well! It takes no more than joining the two files:
  321.  
  322.    COPY LibOne.INF+LibTwo.INF NewLib.INF
  323.  
  324. You can join the .REF and .BI files the same way, or use LibWiz
  325. to generate new .REF and .BI files from the new .INF file.
  326.  
  327.                        Portability Notes                 page 9
  328.  
  329.  
  330.  
  331. Routines for BASIC compilers come in assorted variations.  The
  332. main category is the language used to write the routine: BASIC,
  333. assembly, or other (C, Pascal, Fortran).  Each of these is
  334. portable to a different degree.
  335.  
  336. Routines written in BASIC will only work with the version of
  337. the compiler they were compiled under.  If the routine was
  338. compiled with QB 4.5, it will only work with programs that are
  339. also compiled with QB 4.5, for example.
  340.  
  341. Routines written in C, Pascal, or Fortran are compatible with
  342. QuickBASIC 4.0 to 4.5, BASCOM/PDS 6.0 to 7.1, and VB-DOS.
  343.  
  344. Routines written in assembly language are portable to varying
  345. extents.  Older routines are likely to be compatible only with
  346. QB 1.0 to 3.0 and BASCOM versions before 6.0.  More recent
  347. routines are likely to be compatible with QB 4.0 - 4.5 and
  348. BASCOM 6.0 - 7.1; in this case, they may or may not be
  349. compatible with older versions of these compilers, depending on
  350. the whim of the programmer.  The third level of compatibility
  351. includes BASCOM/PDS 7.0 - 7.1, QBX, and VB-DOS: far string
  352. compatibility.  This is becoming more common.
  353.  
  354. It is possible to write assembly language routines that will
  355. work with all Microsoft-compatible BASIC compilers, from QB 1.0
  356. - QB 4.5, IBM BASCOM 1.0 - 2.0, MS BASCOM 5.35 - 7.1, and QBX.
  357. However, this is only possible if new features (like FUNCTIONs,
  358. LONG integers, huge arrays, and far strings) are ignored, so
  359. there are usually version compatibility constraints.
  360.  
  361. The routines in my BasWiz and PBClone libraries, at least at
  362. the time I write this, are designed with the middle level of
  363. compatibility.  The assembly language routines will work with
  364. QB 4.0 - 4.5 and BASCOM 6.0 - 7.1 (including BASCOM "PDS", the
  365. Professional Development System, and its QBX environment), as
  366. well as VB-DOS.  Source code is provided for the routines in
  367. BASIC so you can compile them with whichever compiler you may
  368. have.  This extends the range of the BASIC routines to the same
  369. level as the assembly routines.
  370.  
  371.                          Miscellaneous                  page 10
  372.  
  373.  
  374.  
  375. If you use the excellent DOS shell 4DOS, try the ADD4DOS batch
  376. file.  It makes descriptions of the LibWiz files available for
  377. the DIR command-- no more having to guess what a file is!
  378.  
  379. Note that LibWiz places certain limitations on the valid
  380. routine names in order to make it possible to screen out names
  381. that are in BASIC's runtime libraries.  Names may not contain
  382. dollar signs, start with underscores, end with "QQ", or contain
  383. lowercase letters.  It is important to understand that BASIC
  384. normally converts routine names to uppercase and removes any
  385. type specifiers from function names, so BASIC is not normally
  386. capable of generating routine names that would break these
  387. restrictions (except for routines ending in QQ). This is more
  388. of a caution for routines that may have been written in other
  389. languages, such as assembly language or C.
  390.  
  391. Due to these restrictions on the routine names, LibWiz will not
  392. work with some libraries (ones which violate the restrictions).
  393. This includes the commercial ProBas library from TeraTech
  394. (formerly from Hammerly Computer Services, Inc), among others.
  395.  
  396. The LibWiz utilities were written using BASCOM/PDS 7.0 and
  397. routines from my BasWiz and PBClone libraries.
  398.  
  399. Sampler disks are available from me for $5.00.  These disks
  400. contain the latest versions of many of my shareware and free
  401. works, including BasWiz, LibWiz, ObjTool and PBClone.  Please
  402. specify disk size (1.44M will be assumed otherwise).
  403.  
  404.    Thomas G. Hanlin III
  405.    3544 E. Southern Ave. #104
  406.    Mesa, AZ 85204
  407.  
  408.