The below code works fine if the file exists and has content. If the file does not exist or has no content, it goes through the steps (executes StartTextInput, etc) but actually writes nothing, and if the file does not exist, it does not write/create it.
I know it has to be something simple that I'm missing...
I've already confirmed the location where it looks for/creates files. When I create a dummy text file with content, it works.
The folder it is supposed to read/write to is not "Read Only", and UAC is off.
opentoread(1,"IGN.txt")
IGN$ = readstring(1)
closefile(1)
if IGN$ = ""
starttextinput("Enter in-game name.")
if gettextinputcompleted() = 1
IGN$ = GetTextInput()
OpenToWrite ( 1, "IGN.txt", 0 )
WriteString ( 1, IGN$ )
CloseFile ( 1 )
endif
endif
Any help appreciated
-Writing programs for years, new to AGK2