forums

TNT Basic Forums > Programming Q&A
Creatinf Files
< Last Thread     Next Thread >
Author
Thread        Post A Reply

11-01-2003 13:40

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

Hi, I'm new to working with files and I'm writing a small code to save my game.

I have the code:

Set Directory User Preferences
int savedg = create file(filename,"save",datatype)
close file(savedg)


but I'm not sure if the second value, "save" is right. It dosnt say anywhere in the help what the second value should be, just

"type is a 4 character string containing the type of the file you wish to create."

for syntax "fileId = Create File (fileName,type,dataFormat)"

When I run the game, it comes up saying that it cannot create the file.

Thanks
MapMaker

11-01-2003 23:53

Posted by:
Miles

Location:
Australia

Click Here to Email Miles   Find more posts by Miles

>>>
Set Directory User Preferences
int savedg = create file(filename,"save",datatype)
close file(savedg)
>>>

I don't think Type really matters, so long as it's consistent. I usually put it as the creator code of the game. I hope you're not acually putting "filename" as the filename, you need to put a string there of the filename. "datatype" needs to be either "Text" or "Data".

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.