Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving changes to a program

Status
Not open for further replies.

Sk8erdude802

Technical User
May 30, 2002
3
0
0
US
im trying to make a sort of proram that wiil ask a question and take an answer. it needs to be able to save this answer to the program itself or in a file that it can recall latter. is that possible?
 
Look for OPEN and PRINT commands in manual or internal help.
You can save anything in program file, but better keep your data in other file.
It will be something similar to:
OPEN "DATAFILE.TXT" FOR OUTPUT AS #1
PRINT #1, Variable
Close #1
OPEN "DATAFILE.TXT" FOR INPUT AS #1
INPUT #1, Variable
Close #1
 
Check out GET and PUT, these are better for saving information.

OPEN "DATA.XXX" FOR RANDOM AS #1
PUT #1, 1, variable
CLOSE

OPEN "DATA.XXX" FOR RANDOM AS #1
GET #1, 1, variable
CLOSE

see my FAQ for better discription of I/O commands
 
trying to save to your .bas files itself could be very bad, first of all Qbasic saves files in a basic format which is tough to understand (unless otherwise specified as text) and once you compile it to a dos executable, I don't think it would work any more.
 
In answer to your real question:

is that possible?

The answer is: yes.

There are various tutorial sites that you can learn these basic skills from. This site is not one of them. Just use any search engin and type in QBASIC for the search parameters and you should get a slue of them.

But to start you off, you should check out the Help files for the commands indicated above in the previous responces. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
If you are using Internet Explorer you can't jusy type in QBASIC, i posted about this earlier, for some reason IE searches your computer for what you want first. So typeing QBASIC in the address bar will open qbasic (don't ask me why), best bet is to goto google
 
I should have said "Just use any [red]internet[/red] search engin and ...." instead.

I just thought that it would be understood that the address bar will search the local computer first then outside connections like domains and internet gateways.

Sorry if I wasn't clear enough. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top