Newbiw program help
Moderators:Administrator, Global Moderator
-
- Newbie
- Posts:1
- Joined:Sun May 30, 2004 10:39 pm
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?
Re: Newbiw program help
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
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