home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / BASIC / PBCLON17.ZIP / LIBRARY.TXT < prev    next >
Encoding:
Text File  |  1991-02-19  |  3.4 KB  |  67 lines

  1. So you've never used a library before and you want to know what gives?
  2.  
  3. A library is a collection of routines, whether written in BASIC, assembly
  4. language, or some other language altogether.  It provides a convenient way to
  5. allow different programs to use the same sets of standard or special-purpose
  6. routines (subprograms or functions, in BASIC parlance).
  7.  
  8. There are two forms of libraries for QuickBASIC.  The form with the extension
  9. ".LIB" is for use with LINK, for creating stand-alone programs which do not
  10. require the QuickBASIC environment.  This sort of library can be made or
  11. manipulated using the LIB utility provided with QuickBASIC.  The form of
  12. library with the extension ".QLB" is for use in the QuickBASIC environment.
  13. It is created with LINK and (unfortunately) can't be manipulated at all.
  14.  
  15. To use a QLB library, you specify the /L parameter when starting up QB:
  16.  
  17.    QB /L PBCLONE
  18.  
  19. You can optionally include the name of your program before the /L switch.
  20.  
  21. To use a LIB library, you specify the name of the library when you LINK your
  22. program.  Either let LINK prompt you for the library or type something like
  23. this:
  24.  
  25.    BC program/O;                       (or whatever)
  26.    LINK program/EX,,NUL,PBCLONE
  27.  
  28. If you are in the QuickBASIC environment and direct the compiler to produce
  29. an .EXE file, it will automatically link the library for you if you started
  30. up QB with the /L option.
  31.  
  32. Suppose you have more than one library that you wish to use?  Well, provided
  33. that you have both of the libraries in .LIB form, this presents no problem.
  34. To create a combined .LIB library, use the LIB utility to extract all of the
  35. .OBJ files from one .LIB and add them to the other one.  You can convert the
  36. new combined library to .QLB form by using a special LINK syntax:
  37.  
  38.    LINK combined.LIB/Q/SE:512,,NUL,BQLB45
  39.  
  40. The last two digits of "BQLBxx" represent the version of the compiler that
  41. you have.  It doesn't necessarily match the formal version number, though, so
  42. you might just want to use DIR and see what the name of the file really is.
  43. BQLBxx.LIB is one of the files that comes with QuickBASIC.  If you have QBX,
  44. use QBXQLB instead of BQLBxx.
  45.  
  46. The "/SE:512" part is only needed when dealing with large libraries, such as
  47. PBClone.  It tells LINK to allocate more space for its internal tables.  This
  48. doesn't affect the size of the resulting library, though, so it never hurts
  49. to use this parameter.
  50.  
  51. If you experience a LINK error, make sure that you're using the current
  52. version of LINK.  I've heard from many people who turn out to have the wrong
  53. version of LINK in their PATH somewhere... when LINK starts up, it will
  54. display its version number on the screen.  The version should be around 3.69
  55. as of QuickBASIC 4.5, or 5.05 for QBX.  You must use the LINK that came with
  56. QuickBASIC-- the one that comes with Quick C is incompatible and the one that
  57. came with BASCOM 6.0 (the one with two periods in the version number) has a
  58. few bugs.
  59.  
  60. If you are using BASCOM 7.x, DO NOT interrupt LINK with a Break or Control-C,
  61. as this may cause it to damage your hard disk!!!  This bug is known to appear
  62. in the LINK that comes with BASCOM 7.0.  I'm not sure whether they fixed it
  63. in BASCOM 7.1.  You may be more familiar with BASCOM 7.x as "PDS" or "The
  64. Professional Development System" (Marketing, ugh).
  65.  
  66. All clear?  No?!  Check your BASIC manuals for more information!
  67.