Create File

Creates a new file

Syntax

fileId = Create File (fileName,type,dataFormat)

Description

This command creates and opens the specifed file and returns the file identifier in fileId. If for any reason the command could not create and open the file then it causes an error.

fileName is a string containing the full path of the file to create. This path is referenced from the current directory. For more information about this see the command Set Directory.

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

dataFormat is a string containing the data format of the file you wish to create. TNT Basic currently supports two types of files...

Data File - "Data"
Data is stored in TNT Basic's own format. These file use less space and a quicker to access, however, they cannot be easily made by hand.

Text File - "Text"
Data is stored as a series of lines in a text file. This takes up more space and is slightly slower to access but the advantage is that they are easy to create by hand.

If this field is left blank then it defaults to a data file.

The file created is automatically opened with write access.


Table of contents