Skip to content

form.addLine

since 1.1.0

Add a new line to the current form.

local line = form.addLine(label, panel[, separator])

Parameters

Name Type Required Description
label string yes the line label
panel ExpansionPanel yes an expansion panel where the line should be inserted
separator boolean optional (default true) separator after the line

Returns

line (FormLine)

Examples

local line = form.addLine("Max RPM")                      -- labelled line
form.addNumberField(line, nil, 0, 20000, getMax, setMax)

local panel = form.addExpansionPanel("Advanced")
local l2 = form.addLine("Smoothing", panel)               -- inside a panel
form.addNumberField(l2, nil, 0, 10, getS, setS)

form.addLine("Notes", nil, false)                         -- no separator after the line

Always keep line local. A global line (as in some older examples) is shared by every script on the radio.

From the official Ethos documentation
form.addLine("Label")
form.addLine("Label", panel, false) -- add a line in an expansion panel
form.addLine("Label", nil, false) -- no separator

Used in

Real-world usage

Called 667 times across 11 open-source Ethos Lua projects. A few short excerpts: