QB4.5/VBDOS routine adder?
-
- Veteran
- Posts: 111
- Joined: Sat Feb 21, 2009 8:19 am
- Location: New York, U.S.
QB4.5/VBDOS routine adder?
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!
Creating magic in the computer community...or at least striving to!
Re: QB4.5/VBDOS routine adder?
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...'
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)
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
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.
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
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