GetEditorSaveFlag()

Summary

Determines whether an editor has changed since it was last saved to a file.

Syntax

flag = GetEditorSaveFlag(string editor_name)

Argument Contents
editor_name The name of the editor, or null for the current editor

Returns

The string "True" if the editor has changed and needs to be saved; the string "False" if it has not changed since it was last loaded from or saved to a file.

Notes

  • A newly opened editor is not marked to require saving. An editor only needs saving after something about it has changed from its initial configuration.

  • The save flag is set automatically whenever the editor is changed, but the user is not prompted automatically when the editor is closed. Use GetEditorSaveFlag() to determine whether or not to prompt the user about saving the editor.

Example

if GetEditorSaveFlag() = "True" then RunDbox("Confirm closing unsaved editor")

Error Codes

Error Type Meaning
NotFound The specified editor does not exist

See Also

Function Summary
GetMapSaveFlag() Determines whether a map has changed since it was last saved to a file
GetLayoutSaveFlag() Determines whether a layout has changed since it was last saved to a file
SaveEditor() Saves an editor to a file
OpenEditor() Creates an editor from a file