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"
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
RE: libraries
qb.exe /l
for 3 years................
Shakespare says "To be or not to be" and we say "1/0"
RE: libraries
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
(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
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.