home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / basic / libwiz13.zip / LIBWIZ.DOC < prev    next >
Text File  |  1992-04-26  |  16KB  |  385 lines

  1.          The Library Wizard's *BASIC Library Manager*    page 1
  2.          =------------------------------------------=
  3.                           Version 1.3
  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.  Merging Libraries ........................................ 7
  46.  
  47.  Portability Notes ........................................ 8
  48.  
  49.  Miscellaneous ............................................ 9
  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. usually extract them from the .LIB using UNLIB.EXE:
  91.  
  92.    UNLIB LibName
  93.  
  94. Note that I said "usually"!  On occasion, LIB refuses to
  95. recognize an object name that UNLIB specifies.  I've inspected
  96. the library in these cases and the object name appears
  97. correct.  I'm not sure why LIB doesn't cooperate.  The problem
  98. is uncommon, however, and you'll probably never run across it.
  99.  
  100.                   The LIBWIZ Library Manager             page 4
  101.  
  102.  
  103.  
  104. To use LibWiz, move to the directory which holds the .OBJ files
  105. and the .INF file for the library you wish to customize.  The
  106. syntax is:
  107.  
  108.    LIBWIZ InfName LibName
  109.  
  110. ...where "InfName" is the name of the .INF file and "LibName"
  111. is the name of the desired .LIB library.  All files (except for
  112. LibWiz itself) must be in the same drive and directory.
  113.  
  114. The option "/B" can be used to force a monochrome display,
  115. although LibWiz normally detects mono displays by itself.
  116.  
  117. If you would like LibWiz to create a quick reference listing of
  118. the routines in the library, add "/R" to the command.
  119.  
  120. I don't -think- any further instructions are needed, as picking
  121. the routines is a fairly simple process-- give it a go. If I've
  122. blundered in this regard, please let me know, and I'll try to
  123. provide more detailed instructions!
  124.  
  125. When you are done, provided that you told LibWiz to go ahead
  126. and create a library, it will create a number of files: an
  127. "include" (.BI) file, a revised library info (.INF) file, and a
  128. library (.LIB) file, at a minimum.  If you specified /R, a
  129. quick reference (.REF) file will also be created.  LibWiz can
  130. also create a quick library (.QLB) file, but you must set an
  131. environment variable to tell it which QLB support library to
  132. use.  This is BQLB40 or BQLB41 for QuickBASIC 4.0 versions,
  133. BQLB45 for QuickBASIC 4.5, and QBXQLB for BASCOM/PDS.  The
  134. variable name is QLBNAME.  So, to have LibWiz create a .QLB for
  135. QuickBASIC 4.5, for example, you'd put this in your
  136. AUTOEXEC.BAT:
  137.    SET QLBNAME=BQLB45
  138.  
  139. The files LibWiz generates will all start with the name you
  140. specified as "LibName".
  141.  
  142. If LibWiz is unable to create a library, it will tell you so.
  143. In that case, the LIB response file (LIBWIZ$$.TMP) will be left
  144. on the disk instead of being deleted.  You can try the LIB
  145. command yourself at the command line, and the resulting error
  146. message(s) will give you some idea of what went wrong:
  147.    LIB @LIBWIZ$$.TMP
  148.  
  149. In the case that a .QLB wasn't generated, chances are that you
  150. have an old version of LINK in your path, or the LIB
  151. environment variable wasn't set to tell LINK where to find the
  152. QLB support library.  You can find out by trying to create the
  153. .QLB yourself at the command line:
  154.    LINK libname.LIB/Q/SE:1024,libname.QLB,NUL,BQLB45;
  155.  
  156. (use the appropriate QLB support library where it says BQLB45)
  157.  
  158.                   The LIBWIZ Library Manager             page 5
  159.  
  160.  
  161.  
  162. At the moment, LibWiz can handle up to 1,023 routines per
  163. library; up to 4 categories per routine; up to 255 categories
  164. total.
  165.  
  166. If you are processing a large library, have patience!  LibWiz
  167. has a lot of work to do and may take a while to read and write
  168. all the files for a big library.  Don't panic!
  169.  
  170.  
  171.  
  172. A few cautions on common problems with LINK:
  173.  
  174.   If you get back a message like "/Q switch not recognized",
  175.   you have an old version of LINK somewhere in your path.  You
  176.   must use the LINK that came with your QuickBASIC or
  177.   BASCOM/PDS compiler to create the .QLB-- older versions of
  178.   LINK don't know what a .QLB is.  You may think you don't have
  179.   an old version of LINK, but if that's the error message,
  180.   there's an old LINK somewhere on your drive!
  181.  
  182.   If you get back a message like "BQLB45 not found", you don't
  183.   have your LIB environment variable set to point to your BASIC
  184.   library area.  The LIB variable works kind of like PATH, but
  185.   it tells the computer where your .LIB files are located.
  186.   Include a SET LIB line in your AUTOEXEC.BAT, and you won't
  187.   have to worry about it again.  That might look something like
  188.   this, assuming your .LIB files are in C:\QB45\LIB:
  189.      SET LIB=C:\QB45\LIB
  190.  
  191.                     The LIBWIZU .INF Maker               page 6
  192.  
  193.  
  194.  
  195. The LibWiz library manager requires an .INF file to tell it
  196. about a library. This file specifies routine names, categories,
  197. object modules, declarations and descriptions.  If you don't
  198. have an .INF file for your library, the LibWizU utility will
  199. handle most of the work of creating it for you.
  200.  
  201. To use LibWizU, move to the directory which holds the .OBJ
  202. files and .BI (declaration) file for your library.  Type:
  203.  
  204.    LIBWIZU LibName
  205.  
  206. ...where LibName is the name of the .BI file.  After chugging
  207. through the declaration and object files, LibWizU will create
  208. an .INF file for the library.  It will also report on Public
  209. routines (routines listed in the declaration file, which are
  210. evidently intended for public use), Private routines (routines
  211. which can be accessed but are not in the declaration file and
  212. are assumed to be private for use by the public routines), and
  213. Orphans. Private routines will not be shown by LibWiz, but will
  214. be pulled into a library if needed by a public routine that was
  215. selected. Orphans are routines which are listed in the
  216. declaration file but which do not appear in the object files.
  217. If there are any orphans, ORPHAN.LST will contain their names.
  218.  
  219. The .INF file created by LibWizU is not complete.  You must
  220. fill it in using a text editor.  A description for each routine
  221. is a good idea, though not strictly mandatory.  A description
  222. may be no longer than 70 characters.  Each routine must be in
  223. at least one category or it is assumed to be private.  A
  224. category can be as many as 16 characters.  A routine may be in
  225. up to four categories (list them on the same line, separated by
  226. spaces).
  227.  
  228. Here's a sample entry for a routine (taken from PBCLONE.INF):
  229.  
  230. Name: CLOCK
  231. Mod : CLOCK.OBJ
  232. Decl: DECLARE SUB Clock (BYVAL DisplayOn%)
  233. Type: Display Time
  234. Desc: Keep a clock displayed on the screen
  235.  
  236. The entries are created in this order by default, but may be in
  237. any order as long as the "Name:" definition is first.  If you
  238. would like to enter comments into the file, use "Note:".  Such
  239. notes will be ignored by LibWiz.
  240.  
  241. If you need information in the .BI file other than just
  242. DECLAREs, such as perhaps TYPE definitions, DEFINT or other
  243. statements, you must create an additional file with an .HDR
  244. (header) extension.  If LibWiz detects the file InfName.HDR, it
  245. will copy that file to LibName.HDR and "REM $INCLUDE" it in
  246. LibName.BI before the DECLAREs for the library.
  247.  
  248.                        Merging Libraries                 page 7
  249.  
  250.  
  251.  
  252. In order to combine two libraries, you must have both libraries
  253. in .LIB form.  A new, combined .LIB can be created with the
  254. LIB.EXE utility that comes with BASIC:
  255.  
  256.    LIB NewLib,+LibOne.LIB+LibTwo.LIB;
  257.  
  258. A combined .QLB can be created using LINK:
  259.  
  260.    LINK LibOne.LIB+LibTwo.LIB/Q/SE:1024,NewLib.QLB,NUL,BQLB45;
  261.  
  262. As noted earlier, you may need to use a different name than
  263. "BQLB45".  If you have QuickBASIC 4.0, it will be either
  264. "BQLB40" or "BQLB41".  If you have BASCOM/PDS ("Professional
  265. Development System"), it will be "QBXQLB".
  266.  
  267. The /SE option is used to tell LINK it may have to deal with a
  268. lot more routines than it expected by default.  If you get an
  269. overflow error, there are too many routines to fit into the
  270. .QLB library.  Take some out.
  271.  
  272. If both libraries have a routine by the same name, there will
  273. be a conflict. You can fix this by changing the name of the
  274. routine in one of the libraries. My ObjTool utility (available
  275. elsewhere) allows you to do this.
  276.  
  277. ObjTool, like LibWiz and LibWizU, expects to deal with .OBJ
  278. files rather than with .LIB or .QLB files.  If you only have a
  279. .QLB library, there's nothing you can do about this.  If you
  280. have a .LIB library, however, you can use the LIB.EXE utility
  281. to remove .OBJ files from the library.
  282.  
  283. When LIB gives you the "Operations" prompt, use:
  284.  
  285.    *ObjName     to copy an .OBJ file from the library onto your disk
  286.    -ObjName     to delete an .OBJ from the library
  287.    +ObjName     to add an .OBJ to the library
  288.    -+ObjName    to update an .OBJ file in the library from your disk
  289.  
  290. If you don't know the names of the .OBJ modules, ask LIB.  Just
  291. press <enter> when it asks for Operations, then give it the
  292. name of a file when it prompts for a "List file".  The
  293. resulting file will contain a list of the modules in the
  294. library and what routines are in each module.
  295.  
  296. When combining libraries, don't forget to combine their .INF
  297. files as well! It takes no more than joining the two files:
  298.  
  299.    COPY LibOne.INF+LibTwo.INF NewLib.INF
  300.  
  301. You can join the .REF and .BI files the same way, or use LibWiz
  302. to generate new .REF and .BI files from the new .INF file.
  303.  
  304.                        Portability Notes                 page 8
  305.  
  306.  
  307.  
  308. Routines for BASIC compilers come in assorted variations.  The
  309. main category is the language used to write the routine: BASIC,
  310. assembly, or other (C, Pascal, Fortran).  Each of these is
  311. portable to a different degree.
  312.  
  313. Routines written in BASIC will only work with the version of
  314. the compiler they were compiled under.  If the routine was
  315. compiled with QB 4.5, it will only work with programs that are
  316. also compiled with QB 4.5.
  317.  
  318. Routines written in C, Pascal, or Fortran are compatible with
  319. QuickBASIC 4.0 to 4.5 and BASCOM 6.0 to 7.1.
  320.  
  321. Routines written in assembly language are portable to varying
  322. extents.  Older routines are likely to be compatible only with
  323. QB 1.0 to 3.0 and BASCOM versions before 6.0.  More recent
  324. routines are likely to be compatible with QB 4.0 - 4.5 and
  325. BASCOM 6.0 - 7.1; in this case, they may or may not be
  326. compatible with older versions of these compilers, depending on
  327. the whim of the programmer.  The third level of compatibility
  328. includes BASCOM 7.0 - 7.1 and QBX: far string compatibility.
  329. This is not yet particularly common.
  330.  
  331. It is possible to write assembly language routines that will
  332. work with all Microsoft-compatible BASIC compilers, from QB 1.0
  333. - QB 4.5, IBM BASCOM 1.0 - 2.0, MS BASCOM 5.35 - 7.1, and QBX.
  334. However, this is only possible if new features (like FUNCTIONs,
  335. LONG integers, huge arrays, and far strings) are ignored.
  336.  
  337. The routines in my BasWiz and PBClone libraries, at least at
  338. the time I write this, are designed with the middle level of
  339. compatibility.  The assembly language routines will work with
  340. QB 4.0 - 4.5 and BASCOM 6.0 - 7.1 (including BASCOM "PDS", the
  341. Professional Development System, and its QBX environment). The
  342. routines in BASIC are compiled with QuickBASIC 4.5.  The
  343. registered versions of the libraries come with source code,
  344. allowing you to compile the .BAS files with your own compiler.
  345. This extends the range of the BASIC routines to the same level
  346. as the assembly routines.
  347.  
  348.                          Miscellaneous                   page 9
  349.  
  350.  
  351.  
  352. If you use the excellent DOS shell 4DOS, try the ADD4DOS batch
  353. file.  It makes descriptions of the LibWiz files available for
  354. the DIR command-- no more having to guess what a file is!
  355.  
  356. Note that LibWiz places certain limitations on the valid
  357. routine names in order to make it possible to screen out names
  358. that are in BASIC's runtime libraries.  Names may not contain
  359. dollar signs, start with underscores, end with "QQ", or contain
  360. lowercase letters.  It is important to understand that BASIC
  361. normally converts routine names to uppercase and removes any
  362. type specifiers from function names, so BASIC is not normally
  363. capable of generating routine names that would break these
  364. restrictions (except for routines ending in QQ, of course).
  365. This is more of a caution for routines that may have been
  366. written in other languages, such as assembly or C.
  367.  
  368. Due to these restrictions on the routine names, LibWiz will not
  369. work with some libraries (ones which violate the restrictions).
  370. This includes the commercial ProBas library from TeraTech
  371. (formerly from Hammerly Computer Services, Inc), among others.
  372.  
  373. The LibWiz utilities were written using QuickBASIC 4.5 and
  374. routines from my BasWiz and PBClone libraries.
  375.  
  376. Sampler disks are available from me for $5.00.  These disks
  377. contain the latest versions of many of my shareware and free
  378. works, including BasWiz, LibWiz, ObjTool and PBClone.  Please
  379. specify disk size.
  380.  
  381.    Thomas G. Hanlin III
  382.    3544 E. Southern Ave. #104
  383.    Mesa, AZ 85204
  384.  
  385.