GetDirectoryList

From Spheriki

Jump to: navigation, search

Returns an array filled with names of all directories found within a specific directory.

Contents

Usage

function GetDirectoryList(directory);

Default directory is the current game's directory. Navigate to others using ../ by going up one directory.

Examples

var folders = GetDirectoryList("save");
for(i = 0; i < folders.length; i++){
	GetSystemFont().drawText(5, 5 + (i * 15), folders[i]);
}
FlipScreen();
GetKey();

A crude (but neat) script to list all folders in the current game's /save/ directory and display them on the screen. This shows how GetDirectoryList can be used to organize files in a subfolder.

Notes

  • To get to the "games" directory use "../".
  • Returns an empty array object, if no directories found.


See also

Personal tools