Whats a library ???

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
bblackmon19
Newbie
Posts: 6
Joined: Sat Mar 26, 2005 11:14 am

Whats a library ???

Post by bblackmon19 »

i keep on hearing talk about a library what exactly is a library and what does it do????
User avatar
lurah-
Veteran
Posts: 206
Joined: Mon Nov 01, 2004 10:47 am
Location: Finland
Contact:

Post by lurah- »

Well, with my english it might be hard to explain shortly.

Check this
It might give you a little help for start.
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

A library, typically, is a file that contains a set of functions and subroutines that pertain to a given task. They are all grouped in a bas module and can be compiled with the compiler as a lib or a quick library (to be loaded in the IDE of the Basic implementation that you use).

In other words, libraries are a good thing for organizing your code into functional groups for one thing.
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

NO!

A library generally has DEFINITIONS of functions + subs. There's a difference. :D
"But...It was so beutifully done"
User avatar
ShadowWolf
Veteran
Posts: 56
Joined: Thu Mar 04, 2004 1:32 pm
Contact:

Post by ShadowWolf »

mathh'raw ? No ? are you talking about mystikshadows post ? dude his post is corrected . also the diff between a sub and fuction are only differn't at IDE level at machine code level it just a proc
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

No, this is defining a sub or function:

Code: Select all

SUB MySub (A, B, C)
  B = A + B
  C = B + C
  A = A + B * C
  'other code
END SUB
That's the definition of a sub or a function....
This is how you call a sub or function:

Code: Select all

MySub A, B, C
In Mystiks terms he was refering to the declarations which are the ACCUAL subs or functions in the program, the definitions just define them, the computer doesn't go to the definitions when it is called:

Code: Select all

DECLARE SUB MySub (A, B, C)
Those ARE the terms...I definatly remeber that....MystikShadows WAS right but I was just correcting him on his terms.... :P
"But...It was so beutifully done"
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Mitth'raw'nuruodo wrote:NO!

A library generally has DEFINITIONS of functions + subs. There's a difference. :D
Incorrect. A library is a binary file which is a collection of procedures that is linked into the program with the linker. The definitions are kept elsewhere, usually in a header file. I believe you're getting things confused with how FB works...and even there, the concept of a library is still the same...it's just that some people believe .a files to be libraries when they're not always libraries but sometimes simply definitions.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

I guess I am...thanks for clearing that up.
"But...It was so beutifully done"
Post Reply