Page 1 of 1

Whats a library ???

Posted: Mon Mar 28, 2005 4:36 pm
by bblackmon19
i keep on hearing talk about a library what exactly is a library and what does it do????

Posted: Mon Mar 28, 2005 4:42 pm
by lurah-
Well, with my english it might be hard to explain shortly.

Check this
It might give you a little help for start.

Posted: Mon Mar 28, 2005 4:49 pm
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.

Posted: Mon Mar 28, 2005 5:33 pm
by Mitth'raw'nuruodo
NO!

A library generally has DEFINITIONS of functions + subs. There's a difference. :D

Posted: Tue Mar 29, 2005 5:17 am
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

Posted: Tue Mar 29, 2005 4:22 pm
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

Posted: Tue Mar 29, 2005 4:48 pm
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.

Posted: Tue Mar 29, 2005 5:23 pm
by Mitth'raw'nuruodo
I guess I am...thanks for clearing that up.