libraries

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

libraries

Post by sid6.7 »

noob question...

okay i still aint ready for the next level
i'll still be a text mode person for a bit
but i see all this stuff about libraries....

what do they do? and how do you use them?
is it something where its a cut and paste
code from the library into your program?
or something more involved...

try not to laugh.... :)
Y-12

Librarys

Post by Y-12 »

Librarys are like DLLs. Librarys do thing for another program. Its kind of hard to explain. I suggest that you read some tutorial on librarys.

A good tutorial to explain librarys is at <a href="http://www.ascii-world.com/">ascii-world</a>. Go to Beginner's Level and click on Lurah's Getting Familiar With Libraries. That should help.

?Y-12
Guest

Post by Guest »

Here's my experience with libraries used with QuickBasic:

Libraries are a collection of routines which can be incorporated into your program at LINK time.

Let's say you have a routine or function which you find yourself using in different program very often. In order not to have to copy/paste them into each program, one way is to use the $INCLUDE. This includes or copies the named file contents into your program. This is an old technique, which in COBOL is callled a COPYFILE.

Another way to be able to include the routine is to put it on a library. You can put a whole bunch of your common routines on this library. Then when you compile and link you specify the name of the library. Your program declares and references the routine or function, and the LINK will include the corresponding OBJECT CODE for the routine/function.

The big advantage to using a library is that you can obtain (or write) libraries that contain assembly language functions. You declare and reference the function in your program, specify the library to the link, and poof you now will execute an assembly language function. For QB or QuickBasic, this is very powerful, enabling you to do stuff that you otherwise could not do (or don't know how).

Maintenance of libraries is not that easy, however. You should have a proper manual.
*****
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

The above post re libraries was submitted by me.
Don't know why the login is being dropped.
*****
guest

Post by guest »

thanks guys good help...
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Plus... it doesn't really matter, with SDL, OpenGL, GFXlib, and all of those windows - based things, it doesn't really matter.
Image
Post Reply