home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
news
/
1601
/
open.bas
< prev
next >
Wrap
BASIC Source File
|
1993-04-01
|
700b
|
33 lines
'test the file capabilities
PRINT "Now will open a file and print some information into it."
OPEN "TESTFILE" FOR OUTPUT AS #TEST
PRINT #TEST, "This is a test of the emergency broadcast"
PRINT #TEST, "system. This is only a test."
PRINT #TEST, ""
PRINT "Please type a sentence."
INPUT ">"; s$
length = LEN(s$)
' break s$ up, one line per word
sLen = LEN(s$)
FOR count = 1 TO sLen
c$ = MID$(s$,count,1)
copy$ = copy$ + c$
IF c$ <> " " THEN [Skip]
copy$ = copy$ + CHR$(13) + CHR$(10)
[Skip]
NEXT count
PRINT #TEST, copy$
PRINT copy$
CLOSE #TEST
PRINT "Done."