Page 1 of 1

QB4.5/VBDOS routine adder?

Posted: Mon Jul 20, 2009 11:57 am
by Harry Potter
Would it be a good idea to create a program to add a SUB or FUNCTION procedure to a file automatically? Maybe both supplied procedures (expandable) and empty ones? I got the idea from the "Useful Batch Files" thread. I'd appreciate any feedback.

Re: QB4.5/VBDOS routine adder?

Posted: Mon Jul 27, 2009 11:49 pm
by OPRESION
I THINK IT'S SIMPLE, YOU CAN DO THIS IN THE COMMAND LINE:

COPY/Y MAIN.BAS+SUBS.BAS

YOU CAN HAVE ALL THE SUBS AND FUNCTIONS YOU WANT IN THE SUBS.BAS FILE.

OR, IF YOU PREFER TO DO IT FROM INSIDE THE VISBASIC EDITOR, ENTER IN THE MENU:

FILE / ADD FILE...

THE QB DOESN'T HAVE HOW TO LOAD FILES FROM THE MENU, BUT THE PDS IN THE FILE MENU HAS 'MERGE' AND 'LOAD FILE...'

Posted: Tue Jul 28, 2009 3:11 am
by burger2227
You can add SUBs or FUNCTIONs using PRINT # to the appropriate BAS file. QB should fix the code placement when opened. Let QB declare it for you when you call and save it.

If you need Quotation marks just use CHR$(34) :

PRINT #1, "LOOP UNTIL INKEY$ <> " + CHR$(34) + CHR$(34)

I've been using QB to add code to BAS programs for years. Just make sure that the file being written to is not in use. Use INSTR to find the SUB program in the Text readable BAS file.

To copy stuff already coded just use LINE INPUT # and PRINT # to transfer a BAS or TXT file's code. You will keep all quotation marks too!

Funny you ask, because I am currently making a program to transfer an image's compressed pixel data to a CSV or BAS file DATA field using PRINT #. I'm about done if you're interested in seeing it.