Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Libraries
#1
Can someone tell me how to use libraries? I know what they are, and what they do, but have never used them in QB. (I want to use them in FB)

Also, how do I make my own libraries?
Reply
#2
Quote:Can someone tell me how to use libraries? I know what they are, and what they do, but have never used them in QB. (I want to use them in FB)

Also, how do I make my own libraries?
Hello Jeremy,
you need an include file *.bi to declare the function/subs
the sourcecode of the lib *.bas

mylib.bi
Code:
declare myfunc(byval parameter as integer) as integer
inclib "mylib"
mylib.bas
Code:
#include "mylib.bi"
myfunc(byval arg1 as integer) as integer
  return arg1+1
end function
fbc -lib mylib.bas
Code:
'testmylib.bas
#include "mylib.bi"
print myfunc(1)
fbc testmylib.bas
testmylib

i wrote it online not tested but this is the way to build and use libs in FB.
take a look in the FreeBASIC/examples/lib folder.

Joshy
sorry about my english
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)