SHIP:Property:variable:context

From Serious Documentation
Revision as of 10:08, 6 August 2013 by Admin (talk | contribs) (Node: Variable)
Jump to: navigation, search

Node: Variable

Property Data Type Description
context** Byte Makes the variable persistent across reboots.

Variables marked persistent must be stored in the registry in a specific name space, or context. A context is a simple 8 bit number, with 0x00 and 0xFF reserved for Serious use. Typically, you'll use context 0x01. If you have multiple GUIs loading on the same physical SIM, you may assign each GUI's variables a different context -- or you can share persistent variables selectively by having some variables share the same context.

Variables are stored by a combined unique value of context + varid + varversion. A persistent variable in one GUI with context 0x01, varid 0x0001, varversion 0x01 is a completely different stored variable than one with a different (say, 0x02) context.

See the related properties persistent, varid, and varversion. In order to make a variable persistent, you must set these 3 related properties as well.

*The persistent property can only be set in SHIPTide.