Newbiw program help

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
hamfreak2002
Newbie
Posts:1
Joined:Sun May 30, 2004 10:39 pm
Newbiw program help

Post by hamfreak2002 » Mon May 31, 2004 4:57 am

hi, i am new to qbasic or programing but i have got a good idea on the basics, but i cant seem to open and save to a text file or get the program to come out of a SUB back to the main program. any tips?

Guest

Re: Newbiw program help

Post by Guest » Tue Jun 01, 2004 4:39 am

Start with sequential files (usually text files)

open "my.fil" for output as #1
print #1,"Hello"
close #1

open "my.fil" for input as #1
line input #1,LL$
print LL$
close #1
(should print hello on the screen)

-----------
subs
--------
declare sub firstone(x$)
firstone "hello"
print "Back from Sub"
stop
sub firstone(msg$)
print msg$
print "exiting sub"
'sub will end when it gets here or use exit sub
end sub

Simplistic examples but something to get you started

Post Reply