# Action Runtime Settings

Action Runtime Settings are similar to Named Variables. However, they are not intended to be used as general purpose variables but rather a means of keeping state for an action after it terminates. The writing of an Action Runtime Setting is far less efficient than storing a Named Variable and named variables are far more accessible from action statements. Action Runtime Settings persist until they are removed.

Action Runtime settings are stored in Runtime Settings sets. The setting column represents the name of the setting while the value column represents the value. The setting column is treated as being case insensitive.

By default the Action Runtime Settings are located in a runtime setting set with the same name of the initial action. ie. the action first run (\ai). At runtime you can switch between different sets by using the Map Action Runtime Settings statement. Setting the mapping to empty is equivalent to setting it to the name of the initial action (\ai). Using this methodology is it is easy to maintain different sets for different actions. The name of the current mapping can be inserted via the \?rs escape sequence.

Action Runtime Settings are set via the Set Action Runtime Setting action statement, are read via Escape Sequences from text fields in actions. These functions operate on the set associated with the current mapping. Action Runtime Settings can be enumerated or saved to named variables by the Extract Preference Set statement.

When setting runtime settings, a setting will be removed if its value is empty. A runtime setting which does not exist has an inherent value of empty. If all settings are removed from a replacement set, the set is removed. Replacement sets are created automatically when required. There is one condition where you might want to store an empty value. There is an override to allow this. See the Set Action Runtime Setting action statement for more information.

Names are case insensitive. Names have leading and trailing spaces and # characters removed. Sequences of multiple space characters are replaced by a single space. Values are single line only and are truncated at the first newline character.

To specify an action runtime setting in a text field the format is: \#name#. The runtime settings referenced in any given action can be found on a text field's context menu in the Insert Runtime Setting submenu.

Enumeration lists of the current mapped set can be returned by the Extract Preference Set statement. Named sets can also be returned as lists or key-value lists by the same statement.

Note that a reference to an action runtime setting does not cause the currently associated runtime settings set to be exported with an action. This is by design. If you want to include a runtime settings set when exporting an action you must specify it on an Include statement.