Re: Libraries

 BBS: Inland Empire Archive
Date: 04-08-92 (09:13)             Number: 39
From: ROB SMETANA @ 914/201        Refer#: NONE
  To: CHRIS HOWARD                  Recvd: NO  
Subj: Re: Libraries                  Conf: (2) Quik_Bas
> forgive the  simpleness of my question, but what benefit do you get
> from linking a  program to a library ? I have not managed to read the
> manuals yet, but  from reading some of these messages, I can see they
> are an important part  of programming. Can someone give me a beginners
> view of what these  libraries are and how they are used.  Any response
> would be greatly  appreciated.

First, Chris, if you plan to compile a pgm to an EXE you MUST link
with at least 1 library:  BCOMXX (or BRUNxx or PDS 7.x equivalents).
These LIB files contain BASIC's 'facilities' to handle all of the
functions and statements you use (PRINT, OPEN, DATA, LOCATE, etc.).

And when you LINK your program, you can include other LIB files as
well -- which would contain 3rd party procedures (or your own
procedures which you've tested, compiled to OBJ form, then added
to a LIB file).  Again, the LIB simply contains the 'facilities'
you've used in your program.  In order to get 'em into your
EXE, you must tell LINK to look for procedures used in your program,
and then add-to-your-EXE anything it needs from the LIB files.

As to your 2nd question (which you didn't ask), the other type of
'library' file that's handy when DEVELOPING programs is a QUICK
LIBRARY (or a .QLB file).  Like LIB files, QLB files contain
procedures (SUBs or FUNCTIONS) you'll invoke in a program you're
developing.
  * When you run QB, you load the QLB file with the "/l" switch:
       qb myprog.bas /l qb  (loads qb.qlb)
  * This is the ONLY way to get access to ASM routines, or 3rd-
    party routines (that you got in OBJ form), or SUBS/FUNCTIONS
    you've written and compiled -- WHILE you're developing a
    program.

Creating LIB and QLB files is v-e-r-y easy using the LIB.EXE and
LINK.EXE programs that came with QB.  For example:
  * QB includes a LIB file called QB.LIB.  To convert it to a
    QLB file:  link /q qb.lib,,nul,bqlb45;

    - "/q" means create a Quick Library (rather than an EXE)
    - "bqlb45" is the "core" set of facilities needed for QLBs.

Hope this gets you started.  If you need details, holler.


--- RBBSMail 17.3A
 # Origin: PCUG BBS - San Francisco HST/V.32 415-621-2609 (RBBS 8:914/201.0)
 * Origin: Gateway System to/from RBBS-NET (RBBS-PC 1:10/8)
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