InitializationValue
InitializationValue[sym]
represents the settable persistent value with which the symbol sym will be initialized.
InitializationValue["context`name"]
represents the settable initialization value for the symbol with the specified complete name.
InitializationValue[sym,{loc1,…}]
specifies the persistence locations to search for a possible initialization value.
Details and Options
- InitializationValue[sym] is equivalent to InitializationValue[sym,$PersistencePath].
- InitializationValue[sym]=value sets an initialization value for sym.
- InitializationValue[sym]=value is equivalent to InitializationValue[sym,$PersistenceBase]=value.
- The following options can be given:
-
EvaluationEnvironment $EvaluationEnvironment the environment in which the value should be used MergingFunction Automatic the function applied to the list of values found ValuePreprocessingFunction Identity the function applied to new values to be assigned ExpirationDate None when the value should expire PersistenceTime None how long the value should persist - A persistence location is given as PersistenceLocation["type"] or "type".
- InitializationValue[sym]=$NoValue specifies that the symbol sym should be unset on initialization.
- Before a new value is assigned in InitializationValue[sym]=value, any specified value preprocessing function is applied to value before the value is assigned.
- If the preprocessing function returns $Failed, the assignment is not performed.
- If no explicit setting for ValuePreprocessingFunction is given, the setting to use is looked up on $PersistencePath.
- An expired initialization value is treated as nonexistent, and the underlying persistent object may be removed.
- Initialization values can be removed with Remove. Remove[InitializationValue[name]] is equivalent to Remove[InitializationValue[name,$PersistenceBase]].
Examples
open allclose allBasic Examples (2)
Generalizations & Extensions (1)
Options (5)
Applications (2)
Properties & Relations (2)
Possible Issues (1)
See Also
Initialize InitializationObjects $Initialization PersistentValue
Related Guides
Introduced in 2017
(11.2)