QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: jackyjoy123 on March 15, 2021, 11:26:14 am
-
Hello,
I know how to write values to binary files, but I would like to create actual text output that I could then copy over to a word processor. Is there a way to do this easily?
thanks
jackyjoy
-
If you’re used to BINARY files, you can just PUT your text to the file and append a CHR$(10) after it.
text$ = “Hello World”
PUT #1, , text$ + CHR$(10)
A second method is just to open for OUTPUT and then PRINT to the file.
OPEN “temp.txt” FOR OUTPUT AS #1
text$ = “Hello World”
PRINT #1, text$
CLOSE
-
Many ways to dump text into file:
Print #1, "Whatever for line 1" Print #1, "This for line #2" Print "MyFile.txt is filed."