TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: PETER DALTON
from: CHRIS GUNN
date: 1998-03-16 23:14:00
subject: Re: QB.QLB+QBSER.QLB=BOTH.QLB

 PD> could you please give me a simple explanation of how to make a library
 PD> from something that I've written? I assume that I can write a piece of
 PD> basic that I want to use for several different programs and make
 PD> it into a library that I then include in each program, but I've never
 PD> managed to do that yet.
Howdy Peter,
You don't need to go all the way through linking it into a QLB.  I'm assuming 
you already have the chunks of code you want common moved into CALLable 
B's.
Open up the main module of a program containing the subroutine(s) you want to 
standardize.  Then Alt-F and Create a new program module named something like 
MODULES.BAS and put what REM's you want at the top.  Use Alt-F Save As and 
save it as Readable Text.
Press  and the module names and subroutines will be listed.  Highlight 
he
routine you want to move and click .  Select MODULES.BAS and tell it 
okay. Alt-F and V will save all of the changes you just made.
Try running your program to make sure it still works.  You may need to 
duplicate INCLUDE, COMMON, DECLARE, or CONST lines in the new module.  The 
next time you open this program, QuickBasic will automatically load 
MODULES.BAS as well.  Keep in mind the load modules can contain only SUB's 
and ON ERROR routines.
Open up the next program you want to work on.  If the same subroutine name 
exists, rename the subroutine itself.  You don't have to change the CALL's. 
Alt-F and Load MODULES.BAS.  Now anything in MODULES.BAS will be common to 
both programs as you work on them.   Use  and  to add additional 
subroutines to your common modules.
You may also want to create a MODULES.BI using what's in QB.BI so you have 
the DECLARE's and other things common to all of your modules.
I've got a whole collection of loadable modules.  My MODULES.BAS has the 
subroutines I use in everything.  Then there's MODEMS.BAS that has modem 
routines, GETKEY.BAS for special keyboard stuff, DRAWBOX.BAS for menu boxes, 
and others.  You can load five or six different modules to support the main 
module code.
When you've got the load modules really stable, you can use them to create 
custom LIB/QLB's.
Chris
--- FMail 0.96â
---------------
* Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.