Help Please!

 BBS: Inland Empire Archive
Date: 08-11-92 (13:01)             Number: 15
From: TONY ELLIOTT                 Refer#: NONE
  To: RANDY HARRIS                  Recvd: NO  
Subj: Help Please!                   Conf: (2) Quik_Bas
Randy,

RH>I have downloaded several QB Libs from this BBS and am anxius to
RH>incorporate the functions into my programs.  I can create programs using
RH>any one of the libraries at a time.  How do I go about using functions
RH>from more than one library in the same program?

During your software development with QuickBASIC, there are two types
of libraries that you'll have to deal with: QuickLibraries (.QLB) and
Link libraries (.LIB).

When you are developing inside the Qb environment, you have to load a
QuickLibrary that contains the library routines you wish to access. If
you want to access routines from more than one library, there are
several different approaches you can take (from easiest to hardest):

    1) Use the LINK program to create a single .QLB from one or more
       .LIBs. For example:

        LINK /Q Library1.LIB [+ Library2.LIB], Output.QLB, NUL, BQLB45;

        The above will generate a file called Output.QLB which will
        contain all of the routine in Library1.LIB and Library2.LIB.
        This method is relatively easy, but it doesn't give you a great
        deal of control as to exactly WHAT goes into the final .QLB.
        If, for example, two two .LIBs were both pretty big, you might
        not have much room left in the environment after the QLB is
        loaded.

     2) Use MicroHelp's PREQLB utility or Crescent Software's MAKEQLB
        utility to create a custom QLB which contains only the routines
        needed by your program. These utilities are public domain and
        available from both source free of charge, or can be downloaded
        from several BBSs.  They analyze your source code files to
        determine what "external" routines are needed, then they issue
        the appropriate commands to LINK.EXE to generate the QLB for
        you.  Really neat stuff!

     3) You can manually build a combined QLB yourself using a response
        file, batch file or whatever. If you need more details in this,
        I would suggest that you check some back issues of BASICPro for
        articles on libraries. If you have any specific questions, let
        me know!

The above covers the environment. Now what about making an .EXE? There
are a couple of ways to go here as well.

    1) If you want to "Make and EXE" from the environment, you need to
       have a .LIB that matches the contents of your .QLB extactly, and
       has the same primary name as your .QLB (i.e., if you have
       MYSTUFF.QLB, you also need a matching MYSTUFF.LIB). You can use
       the LIB utility to combine two .LIBs into a single one:

        LIB MYSTUFF +Library1.LIB + Library2.LIB;

      This will create a new libraru called MYSTUFF.LIB which contains
      all of the routines in Library1.LIB and Library2.LIB.

    2) You can manually compile and LINK from the DOS command line.
       Because the environment often uses compiler switches not needed
       by your program (which can result in a larger, slower .EXE),
       most people compile and link manually:

        BC Program.BAS [switches] ;
        LINK /EX Program,,NUL, [Library1 [Library2 etc.]] ;

       For example: If you have a program called TEST.BAS which calls
       routines in Library2.LIB and Library2.LIB, you can compile and
       link as follows (to create a 'stand-alone' program):

        BC TEST /O ;
        LINK /EX TEST,,NUL,Library1 Library2 ;

Hope this helps!

Tony
___
 X EZ 1.39 X Spaghetti code means job security.

--- Maximus 2.01wb
 * Origin: Bare Bones 2.x the MAXimus! (1:133/305)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET