Problem with file IO
by Selin · in Torque Game Builder · 03/15/2011 (10:23 pm) · 3 replies
I had a problem with file IO while save the data. This code is from internet. I can't get the test.txt file in my directory as the console there is already written file written. Can anyone tell me what the problem occur?
funtion writeFile()
{
%file = new FileObject();
if(%file.openForWrite("./game/data/test.txt"))
{
%file.writeLine("Hello World!");
echo("File Written");
}
else
{
error("File in not open for writing");
}
%file.close();
%file.delete();
}
funtion writeFile()
{
%file = new FileObject();
if(%file.openForWrite("./game/data/test.txt"))
{
%file.writeLine("Hello World!");
echo("File Written");
}
else
{
error("File in not open for writing");
}
%file.close();
%file.delete();
}
About the author
Torque Owner Chris Labombard
Premium Preferred