×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

libraries

libraries

libraries

(OP)
i wrote a program ;

Declare sub makefont (x%,y%,color%,size%,typ%)
'no loop

sub makefont (x%,y%,color%,size%,typ%)
'a little code
end sub


i saved it as a library and then

'$include: 'font.lib'
call makefont(x%,y%,...etc.)

this couldn't recognize back the sub makefont..There was some yellow chr$ codes on the screen..

Now i wonder how can we save our subs and recall them from
our libraries ?..

Or does it mean that i missunderstood the mentatlity of libraries ?..
Help pls..

Shakespare says "To be or not To be"
And we say "I/O"





RE: libraries

You have to start qbasic with the /L parameter.  This tells qbasic to support libraries.

RE: libraries

(OP)
well i have a .bat file ;
qb.exe /l

for 3 years................


Shakespare says "To be or not to be" and we say "1/0"


RE: libraries

put:
  Declare sub makefont (x%,y%,color%,size%,typ%)
in your program.
not...
  '$include: 'font.lib'

if anything place:
  '$include: 'font.BI'

(Basic Include)

which would simply include the text:
  Declare sub makefont (x%,y%,color%,size%,typ%)

so for that matter just place the line in your program instead of the include.

the /l switch is what loads the library, not the '$include

Have Fun, Be Young... Code BASIC
-Josh

http://cubee.topcities.com

PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.

RE: libraries

Does QB create the BI?

(btw, you have to go /l then your lib name, otherwise it just loads qb.lib/qbx.lib/vbdos.lib depending on your version)

RE: libraries

No...

You make a blank text file.

Copy/Paste your declarations into it...

Such as:
  Declare Sub/Function ...
  Type MyType
    X as ...
    Y as ...
  End Type
  Dim Shared Var As ...
  Const PI = 3.1415
  etc...

Then save it. The .BI extension is optional (It stands for Basic Include)

This is more or less the equivalent of a header (.H) file in C/C++

the difference is (I think... it has been awhile) in basic you can only include 1 file. in c/c++ there is no limit.

Also you can not place commands in include files in basic.
  (such as X = Y + 1, or SCREEN 13)

----------------------------------------------
/L (by itself) loads QB.QLB

/L MYLIB loads MYLIB.QLB

when you create EXE, your MYPROG.BAS generates MYPROG.OBJ which is then linked with QB.LIB (or MYLIB.LIB respectively) to create MYPROG.EXE


Details:
MYLIB.BAS is compiled and creates MYLIB.OBJ
MYLIB.OBJ is linked with QB.LIB to create MYLIB.LIB using LIB.EXE
MYLIB.LIB generates MYLIB.QLB using LIB.EXE

MYLIB.QLB is loaded into QB using /L MYLIB

MYPROG.BAS is compiled and creates MYPROG.OBJ
MYPROG.OBJ is linked with MYLIB.LIB to create MYPROG.EXE using LINK.EXE

Have Fun, Be Young... Code BASIC
-Josh

http://cubee.topcities.com

PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close