SetMapFile()
Summary
Sets the filename for a map.
Syntax
SetMapFile(string map_name, string file_name)
| Argument | Contents |
|---|---|
| map_name | The name of the map or null for the current map |
| file_name | The filename for the map |
Notes
-
The name of the file is shown in the title bar of the map window, once SetMapTitle() has been called.
-
This string will be the default filename that SaveMap() uses.
-
SetMapFile() does not check if the filename exists; nor does it check whether the file name is valid.
-
After opening a map with OpenMap(), this function can be used to set the filename to null, to force the map to be saved into a new map file.
-
This function can also be used to change the file that the map will be saved into when the user chooses File-Save.
Example
//Get the filename for the current map
map_file = GetMapFile()
//Modify and set the filename
parts = SplitPath(map_file)
new_file = parts[1] + parts[2] + "newname" + parts[4]
SetMapFile(, new_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 |
| GetMap() | Gets the name of the current map |
| GetMaps() | Get a list of maps and the name of the current map |
| GetMapNames() | Gets a list of the names of maps in the system |
| GetMapFile() | Gets the name of the file in which a map was last saved |
| GetMapTitle() | Gets the title of a map |
| SetMapTitle() | Sets the title of a map |