QB4.5/VBDOS routine adder?

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply

Would this be a good idea?

Yes
1
50%
No
1
50%
 
Total votes: 2

Harry Potter
Veteran
Posts: 111
Joined: Sat Feb 21, 2009 8:19 am
Location: New York, U.S.

QB4.5/VBDOS routine adder?

Post 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.
Joseph Rose, a.k.a. Harry Potter
Creating magic in the computer community...or at least striving to! :(
OPRESION
Veteran
Posts: 61
Joined: Tue Jan 16, 2007 4:15 am
Location: Mexico

Re: QB4.5/VBDOS routine adder?

Post 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...'
MY PAGE: http://Qbasic.phatcode.net" target="_blank
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post 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.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply