Ask Open File

Asks the user for a file to open


fileId = Ask Open File (writeAccess,type,dataFormat)


This command displays a dialog to the user asking them to specify a file to open. If the user selects a file, then that file is opened and the file identifier is returned in fileId. If the user cancels the operation then fileId is set to -1. If for any other reason the command could not create or open the file then it causes an error.

writeAccess is a boolean which specifies whether or not you want to be able to write to the file. If you pass true then you will be permitted to write to the file, if you pass false then you will only be allowed to read from the file.

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

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.

Table of contents