Set Directory

Sets the current directory

Syntax

Set Directory User Preferences
Set Directory System Preferences
Set Directory Temporary
Set Directory Game

Description

This command sets the directory to get files from. The directory is the folder the file is in.

Set Directory User Preferences
int
file=Open File("Test",false,"Type")

This piece of code will open the file called "Test" from the user preferences folder.

There are 4 folders that can be used to store files...

User Preferences - This folder should be used to store files that only the current user of the computer will need (e.g. save game files). Each user of the computer has a different preferences folder so they only have access to their own preferences.

System Preferences - This folder should be used to store files that all the users have access to (e.g. high scores)

Temporary - This folder can be used to store temporary files. Be careful however, once a file has been closed there is no guarantee that it will still be there later.

Game - This folder should be used to store files that are required by your program. It is not supposed to be used to store files like saves or preferences.

The default directory is the user preferences folder.

You can also access folders that are contained inside these folders by specifying a longer path name to the file.

int file
Set Directory User Preferences
New Folder
("Folder")
file=Open File(":Folder:Test",true,"Type")

This piece of code creates a folder called "Folder" and then creates a file called "Test" inside that folder. The : is used to specify the path to a particular file.


Table of contents