RedcrabX – Slider Guide

Interactive value control published as a variable  |  Version 1.0

Back to Quick Start Guide

Table of Contents


1. Overview

A SliderBox places an interactive slider on the worksheet. The slider's current position is published as a named variable (default S1) that any MathBox, PlotBox, ChartBox or LabelBox can reference.

Dragging the slider updates the variable live and recalculates every dependent box, which makes it ideal for exploring how a result changes as one input varies – a lightweight “what-if” control without retyping numbers.

2. Inserting a Slider

On the Home ribbon, in the Insert in Workspace group, click the Slider button (located right after Chart). The cursor turns into a cross-hair; click anywhere on the worksheet to drop the slider.

A new slider is created with these defaults:

Toolbar controlPurpose
nameThe variable name the slider publishes (default S1).
rangeThe adjustable range as min..max:step (default 0..100:1).
valueThe current value; type a number to set the slider exactly.

The slider itself appears inside the box, with the current value shown above it as name = value.

3. Variable Name

The name field sets the identifier under which the slider value is stored. It follows the usual variable-naming rules: it must start with a letter or underscore and may contain letters, digits and underscores. Names are case-sensitive, so S1 and s1 are different variables.

If you type an invalid name, the field reverts to the previous valid name. Choose a unique name so the slider does not collide with a variable defined by a MathBox.

4. Range and Step

The range field defines the lower bound, upper bound and (optionally) the step size using the same notation as MathBox range literals:

EntryMeaning
0..100:1From 0 to 100 in steps of 1 (integer slider).
0..10:0.1From 0 to 10 in steps of 0.1 (one decimal place).
-50..50:5From −50 to 50 in steps of 5.
0..1From 0 to 1 with continuous (un-stepped) movement.

The number of decimal places shown in the value display is derived from the step, so a step of 0.1 shows one decimal and a step of 0.01 shows two.

The upper bound must be greater than the lower bound. The step is optional; omit :step for smooth, continuous adjustment. A comma form such as 0,100,1 is also accepted.

5. Variables and Value Lists in the Range

The bounds and step are not limited to fixed numbers — each part may be an expression that references another variable. This lets one box control the limits of a slider:

EntryMeaning
0..N:1From 0 to the current value of variable N in steps of 1.
a..b:sBounds and step taken from variables a, b and s.
0..2*pi:pi/180From 0 to 2π in one-degree steps.

Instead of a continuous range you can also supply an explicit list of values that the slider steps through one by one (the slider thumb selects the entry, not a position):

EntryMeaning
[1,2,5,10,20,50]Steps through exactly these six values.
[0..1:0.1]A bracketed range literal expands to 0.0, 0.1, … 1.0.
myValuesThe name of an array or set variable defined in a MathBox.
Ranges that use variables (as bounds or as a value-list variable) update live: whenever the worksheet recalculates, the slider re-reads the referenced variables and adjusts its bounds or value list automatically. The current value is kept on the nearest valid position.

6. Setting the Value

There are three ways to change the slider value:

Any value you enter is clamped to the current range. Each change immediately republishes the variable and recalculates dependent boxes.

7. Using the Slider Variable

Reference the slider's variable by name in any other box, exactly like a variable assigned with := in a MathBox.

// Slider published as S1 over 0..100:1

radius := S1                // use the slider value directly
area   := pi * S1^2         // area follows the slider live

In a LabelBox set to Reference mode, enter S1 to display the live value. In a PlotBox or ChartBox, use S1 anywhere an expression is allowed to drive the visualization from the slider.

Combine several sliders (S1, S2, …) to build an interactive dashboard where a formula or chart responds to multiple inputs at once.

8. Moving and Resizing

Click the slider box to select it. Drag the border to move it, or drag the bottom-right handle to resize it. Widening the box gives the slider a longer track and therefore finer manual control.

9. Saving with the Worksheet

When the worksheet is saved, every SliderBox stores:

All of these are restored when the worksheet is reopened, and the slider variable is republished so dependent boxes show the saved value immediately. A range that references variables or an array/set value list is stored as text and re-resolved against the recalculated worksheet on load.

10. Tips and Best Practices


Back to Quick Start Guide