FILENAME$ = "HELLO.TXT"
OPEN FILENAME$ FOR OUTPUT AS #1
PRINT #1, "HELLO WORLD!"
OPEN FILENAME$ FOR INPUT AS #1
LINE INPUT #1, EXAMPLE$
The only thing is that you can't read and write at the same time unless you open the file using the BINARY method instead of the INPUT method or the OUTPUT method. Unfortunately, that method works rather differently compared to INPUT/OUTPUT. I'd avoid it if you're just writing text to files.