Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linking functions into QB4.5
#1
Hi All,

I have written two functions that are currently in a library called asm.qlb that I must call at runtime using:

qb /l asm.qlb

and then declare the functions whenever I wish to use them. I understand that it is possible to roll functions into the "standard" qb45 distribution so that they appear seamless to the user - can someone please hold my hand and tell me how to do that? I thought it was

link /q asm.lib,asm.qlb,,brun45.lib

but that threw an error when I tried it.
Reply
#2
Make a file. Call it, say, "Declares.bi". Inside the file, put all the declarations for the subroutines and functions in your library.
Then make a file, call it "Template.bas", and in it put this:
Code:
'$INCLUDE: 'Declares.bi'
Then make a file, call it "SDefault.bat". In it put:
Code:
QB Template.bas /Lasm
Then whenever you want to write a program that uses your library, load SDefault.bas.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#3
Cheers - however I have been led to believe that it is possible to roll the functions into the main runtime library used by qb45 so that there is no need for any templates or command line switches.

Thus from a user POV the functions would appear exactly the same as the built in functions such as inp and so on.
Reply
#4
Hmm. You mean make it so that you can just flip open QB and use your own function, without including a lib?
Probably, yes. I'm not sure, though. Sorry.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#5
Quote:Cheers - however I have been led to believe that it is possible to roll the functions into the main runtime library used by qb45 so that there is no need for any templates or command line switches.

Thus from a user POV the functions would appear exactly the same as the built in functions such as inp and so on.

You can add the functions to QB.LIB using LIB.exe

You have to make the declare statements though.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#6
You could write those two functions in another .BAS file and then use it as a module. The only advantage of this is you could complete your program in one module and write all the supporting functions in the other module. Then you could compile the second module into a lib and use the lib instead of the module.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)