QBasic Program output to be stored to a .txt or .csv or .dat

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Posts: 3
Joined: Fri Dec 21, 2012 2:33 pm

QBasic Program output to be stored to a .txt or .csv or .dat

Post by logamuthu » Tue Sep 09, 2014 8:14 pm

I need help for QBasic 1.1 program output to be stored in a .txt / .csv / .dat file in my Hard Disc for later read / printout etc.,

I have been using QBasic.1.1 for over 2 decades - see a sample .bas
program and supported .dat files attached herewith.

The results of running this program get displayed on the screen and
vanish in the next keystroke - I am unable to save the results in a
file .txt / .dat / .csv file in my hard disk.

I have tried the <redirect> function of MS DOS but the system just hangs.

Please help me!

User avatar
Posts: 2281
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Re: QBasic Program output to be stored to a .txt or .csv or

Post by burger2227 » Thu Sep 11, 2014 7:39 am

We'd have to see your code to see what you are trying to do. Please put code inside of the CODE box buttons.

As to file attachments here, you would have to supply a link address to Drop box or such.

OPEN filename$ FOR OUTPUT AS #1 clears a file for new data using PRINT # or WRITE # for CSV files.
OPEN FOR APPEND adds data to the end of a new or previously written to file.

OPEN FOR BINARY or RANDOM use GET# or #PUT simultaneously to read or write.
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