SplitScript reference / setVariable

setVariable

Function

setVariable<T>(name: String, value: T) -> None where T: Display

Sets a custom variable in the timer runtime.

The value is visible to layouts that display autosplitter variables.

Parameters

  • name: The variable name.
  • value: The displayed value. It is converted to text using the same rules as string interpolation.

Effects: writes timer state

Runtime behavior: available everywhere; synchronous

Examples

Expose a layout variable

setVariable("Points", 42)