Qbasicnews.com
November 19, 2019, 10:22:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Library help  (Read 2819 times)
zoasterboy
Guru
**
Posts: 295


Personal Text!


WWW
« on: November 03, 2006, 09:35:19 PM »

How do you create/use a library in QB?
Logged

-yah
zoasterboy
Guru
**
Posts: 295


Personal Text!


WWW
« Reply #1 on: November 04, 2006, 08:31:01 PM »

Fine... Ill find a tutorial somwhere.
Logged

-yah
E.K.Virtanen
Senior Member
**
Posts: 166



WWW
« Reply #2 on: November 06, 2006, 07:48:09 PM »

Quote from: "www.ascii-world.com"

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
Logged

url=http://www.ascii-world.com]ASCII-World.com[/url]
Yeah, nick changed from lurah, but bullshit's are the same.
zoasterboy
Guru
**
Posts: 295


Personal Text!


WWW
« Reply #3 on: November 07, 2006, 01:22:12 AM »

Kewl thanks.
Logged

-yah
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!