Qbasicnews.com

Full Version: QB Lib access can be annoying...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well, say you have a large collection of files that require the standard Qb library. What I do, is I drag the files from the folder onto the QB icon on my desktop. Works fine, expect when the program needs to use the standard Qb lib. Then I have to load QB with the Lib, and find the file through there. that may take a while, as I have deep directorys is some recesses of my QB folders. So I thought of this last night:

Code:
SHELL "D:\qb45\qb.exe /l qb /ah " + COMMAND$

Just compile this with the right directory, and hey presto! You can drag a file onto it and it will also load the QB lib! Works with any other Library as well. But you may want to change the "Working directory" in the EXE's properties to your main QB folder. This is much more convienient. The only catch is that it reduces the free memory by about 7Kbs or so, down to about 21-22Kbs.
My bat file, for developing Novix:

Code:
..\..\QBx BIN\NVX25.MAK /Ah /Es /L LIB\NOVIX

Folder structure:

QBasic71\FosDev\Novix25\BIN\


Novix bas files in the BIN folder, and QBX.EXE in the QBasic71 folder.

Default folder when in QB, will be the same as the BAT file is in, namely:
QBasic71\FosDev\Novix25\


And the bat file takes up less memory then the exe.
Yes, I use BATs for my current projects too, but when you have several files that require a library, you dont want to have to make a bat for each of them just for easy access, do you?
You can drag and drop stuff over batch files...

Code:
E:\COMPILA\QB45\QB.EXE %1 /L /AH

for example.
When I drag and drop over a batch file, it just gives me an error and says "C:\WINDOWS\DESKTOP" and then closes.

is that what %1 does? Is that like the COMMAND$ variable?
%1 is the first variable on the commandline after the bat file:

batfile %1 %2 %3 %4 %5 %6 [aso]

So:

batfile hi there you little thing

Would result in:
%1=hi
%2=there
%3=you
%4=little
%5=thing


So:
Code:
@echo %3

Would write out:
you

On the screen.



So, it's somewhat like command$, imo it's even better as you can get different parts of the commandline easily.
personally, i have a bunch of libs in the same folder as qbasic 4.5. then i have a whole bunch of bats. (shortcuts need the f: or E:, which is bad for a flashdrive when the drive changes names a whole bunch) then each bat is named something like rellib 4.5, ugl 4.5, dqb 4.5, and each bat loads qbasic with that lib.
Personally I use the freakin' DOS box for DOS programs Big Grin

And y'all should do that.
barok: I've got a nice directory structure... Wink

nath: Agreed, I use it as well (W2K).