Hi all,
I have a function which saves a file using RequestFile, CreateFile, OpenFile, and CloseFile.
The file is created correctly, and in the right place with RequestFile and CreateFile, but when I open the file with OpenFile it returns null.
Here's the code:
All help is appreciated - thanks!
I have a function which saves a file using RequestFile, CreateFile, OpenFile, and CloseFile.
The file is created correctly, and in the right place with RequestFile and CreateFile, but when I open the file with OpenFile it returns null.
Here's the code:
Function saveFileAs() Local time:String = CurrentTime$() Local timeOut:String[] = time.split(":") Local timeString$ = timeout[0]+timeout[1]+timeout[2] filter$="Character Files (.chr);All Files:*" filename$=RequestFile( "Save File As:",filter$,True) saveFile=CreateFile(filename$) saveLns=OpenFile(filename$) WriteLine saveLns,"RPG-X Character Creator Saved Character File" WriteLine saveLns,"Created on "+CurrentDate$()+" at "+timeString$+"." WriteLine saveLns,"-------------------------------------------------" WriteLine saveLns,"" WriteLine saveLns,"Name: "+TextFieldText(characterName) WriteLine saveLns,"Age: "+TextFieldText(characterAge) WriteLine saveLns,"Gender: "+SelectedGadgetItem(charGenderComboBox) CloseFile savedLns Return 0 End Function
All help is appreciated - thanks!