Create unique filename and write to it
Posted: Mon Aug 17, 2015 6:28 pm
Hi all! I'm trying to figure out file naming while creating and writing to said file.
I have a field where users can input their names. I want to create a new file with their name in it, then write to this file (put their scores into it).
I'm following BYU's "Working with External Files" tutorial and it's getting me most of the way there but only for files that are already named or do not use user input to name the file itself. I know from prior experience if I try to assign their input into a variable, then name a file after that variable, it won't work. For example:
This saves their input (name) into a variable (gname) but I know "gname.txt" will just create a new txt file named gname (not their input). I'm sure there's some simple solution I'm just not finding in Google searches so any help would be appreciated!
I have a field where users can input their names. I want to create a new file with their name in it, then write to this file (put their scores into it).
I'm following BYU's "Working with External Files" tutorial and it's getting me most of the way there but only for files that are already named or do not use user input to name the file itself. I know from prior experience if I try to assign their input into a variable, then name a file after that variable, it won't work. For example:
Code: Select all
global gname
put name into gname
open file "gname.txt" for append