File types with inputted names

Hi, I'm currently making a program that allows people to code some Truebasic in Truebasic. It's not very practical, but it'll help me for my project next year in school.
In order to not overwrite files every tiem you program, I put an input for the names of files to be used in the program. However, I want them to be saved as a .txt and I can't figure out how.
I have read the section on data storage in files in the online Bronze manual, but it didn't show how I might do this.
Thanks!

Comments

Read and write to text files

Hi,

Here is a fragment of code that will read an entire text file and store each line of text in an array:
DIM any$(0)
OPEN #99: name filename$, create newold, org text, access outin
LET count=0
DO while more #99
LET count=count+1
MAT REDIM any$(count)
LINE INPUT #99: any$(count)
LOOP
CLOSE #99

Here is another fragnent that writes an array to a text file:
OPEN #99: name filename$, create newold, org text, access outin
ERASE #99
SET #99: MARGIN maxnum
LET count=ubound(any$)
FOR n=1 to count
PRINT #99: any$(n)
NEXT n
CLOSE #99

I hope this helps.
Regards
Big John