GetMapFile()

Summary

Gets the name of the file in which a map was last saved.

Syntax

file = GetMapFile(string map_name)

Argument Contents
map_name The name of the map, or null for the current map

Returns

A string indicating the name of the file from which the map was loaded, or to which the map was most recently saved. If the map has never been saved to a file, GetMapFile() returns null.

Notes

  • The name of the file is shown in the title bar of the map window.

  • SetMapFile() can be used to change the name of the file, or set the filename to null.

Example

// Get the name of the current map
map_name = GetMap()
// Get the filename for the current map
map_file = GetMapFile(map_name)
//Show both
ShowMessage("Map " + map_name + " is from file " + map_file)

Error Codes

Error Type Meaning
NotFound The specified map does not exist

See Also

Function Summary
SaveMap() Saves settings for a map window to a file on disk
OpenMap() Open a map file and display it in a map window
GetMapSaveFlag() Determines whether a map has changed since it was last saved to a file
SetMapSaveFlag() Sets the flag that indicates whether a map has changed since it was last saved to a file
SetMapFile() Sets the filename for a map
GetMapTitle() Gets the title of a map
SetMapTitle() Sets the title of a map