home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / bas / hanlin3 / libwiz20 / libwiz.doc < prev    next >
Text File  |  1994-11-05  |  17KB  |  394 lines

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