Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Library help
#1
How do you create/use a library in QB?
-yah
Reply
#2
Fine... Ill find a tutorial somwhere.
-yah
Reply
#3
Quote:It´s not just once or twice when some one have asked that why and how to use and make library with QBasic.
You can use libraryes as you use Sub´s and Function´s.
Library is really easy to create and you can add there routines and codes that are used
in your programs often, just as you use Sub´s and Functions.
Well, why use own library instead of Sub´s or Functions?
In QBasic is a limit that all know´s. It´s called 64K barrier.
But using your own libraryes, you can avoid it.
EXE´s are created on QBasic with two program co-operation.
At first it will be compiled as a OBJ file with BC.EXE and after that
it will be linked to EXE with LINK.EXE.
Libraryes are added on your program on linking part, after BC.EXE compile´s your program to OBJ.
64K limit is on BC.EXE program not on LINK.EXE anymore (when libraryes are added also) so basicly
you can do this way programs what size´s can be more than 64K. In matter affact, there are
no limits then.

Here is a simple example how to create and use your own library.
Start QB.EXE with no parameters.


Code:
Sub PrintMe
Print " I made it!!!"
End Sub

Now you gotta make it as a library. Just go on "Run" and choose "MAKE LIBRARY..."
Ok, so now you got a library there.
Now quit your QBasic and re-start it with parameter
QB.EXE /L YourLibrary.QLB
Now, type these line and you see how it works.


Code:
Declare Sub PrintMe Alias "PrintMe" ()
Print "Now we move on library..."
Call PrintMe
Print "...and now we are back on main program."
End

Now, press F5 and see what happends Wink
url=http://www.ascii-world.com]ASCII-World.com[/url]
Yeah, nick changed from lurah, but bullshit's are the same.
Reply
#4
Kewl thanks.
-yah
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)