SHIP:Node:variable

From Serious Documentation
Jump to: navigation, search

Node Home

Node Type Description
variable Run-time value accessible by scripts and able to generate events on change.

variable nodes hold run-time values. Declarations of variables is via a variable node, rather than embedding the declaration in the script as is traditional in pure coded languages.

variable nodes can exist only in the layout area.

Ancestors

The following nodes are permitted to have variables as descendants:

Node Type Description
box A generic rectangular container, available as a reusable resource or layout element.
display Contains the visual GUI layout for a specific LCD display/touch set.
group Lightweight node that encloses other nodes for pure organizational benefit, or to create an array of nodes.
layout Top of the Layout Area within a SHIP GUI, which completely describes how the GUI is visually organized.
listener Monitors one or more properties (including variable values!) for changes, and on changes invokes a script.
page Visual layout area for a specific GUI "page", or "screen"
text Defines a text resource or a visual text representation.
timer Generates delays and timed alarm events.
variable Run-time value accessible by scripts and able to generate events on change.

variable nodes are permitted directly underneath these nodes.

Descendants

The following nodes are permitted within variables:

Node Type Description
constant Defines a constant value for use in SHIPTide properties or SAIL scripts.
group Lightweight node that encloses other nodes for pure organizational benefit, or to create an array of nodes.
listener Monitors one or more properties (including variable values!) for changes, and on changes invokes a script.
script Run-time algorithms, written in SHIPSail.
timer Generates delays and timed alarm events.
variable Run-time value accessible by scripts and able to generate events on change.

only these nodes are permitted directly underneath the variable node.

Properties

Property Name Data Type Description
name** String The name used to identify this node in SHIPTide.
persistent** Boolean Makes the variable persistent across reboots.
context** Byte The name space for this persistent variable on this SIM.
varid** Short Unique in-context Variable ID for a persistent registry variable.
varversion** Byte Unique in-varid version number for a persistent registry variable.

*available at SHIPEngine run time only and cannot be set in SHIPTide. Use a Sail script at shiplaunch time if this property needs to be set when the GUI starts to run.

**available only in SHIPTide; cannot be accessed from Sail scripts at run-time.

Examples