Manual
Overview
Language
IntroductionScenes & structureText & inlineGraphsCode panesAnimationDataReuse & logicExpressions & parameters
Elements
Text
ParagraphHeading 1Heading 2Heading 3Heading 4Unordered ListDivider
Media
ImageTableEquation
Callouts
NoteDefinitionExampleTask
Graph
GraphLinePolygonCurveIntegralScatterHistogramPointSegmentVectorCircleSquareRectangleTriangleStarDiamondHexagonTextAxis labelAxis BraceFitResidualsContourHeatmapParameter
Code
Code canvasLines
Animation
CueDraw cueTrace cueHighlight cueSpotlight cueType cue
Structure
SceneStep
Reference
Internote Reference
Inline
Formatting
BoldItalicsInline CodeHighlightLink
Text colour
Red textOrange textYellow textGreen textTeal textBlue textPurple textPink textGrey text
Maths
Maths
Reference
Internote ReferenceValueConstant
Other
FootnoteIcon
Directives
DatasetIncludeConstantsTemplatePresetConditionalForIgnore
Keyframes
KeyframeZoom keyframe
Attribute types
?
  1. Directives
  2. For

For

@forDirective

Repeats its body. The implicit attribute `n` is a non-negative count (`@for:3`) or an inclusive range (`@for:0..6`) that iterates upward; inside the body `{{i}}` splices the counter, and `as:` renames it. Ranges must ascend — a descending `from..to` is a compile error.

Attributes

nRequiredImplicit
How many times, or which values: a non-negative integer count (@for:3), or an inclusive from..to range (@for:0..6) that iterates upward.The head shorthand supplies it: @for:value
as
Names the counter — `as: k` makes the splice `{{k}}` instead of `{{i}}` — which is how nested loops tell their counters apart. Must be a valid identifier.

Allowed content

Body { }The content to repeat — spliced once per iteration with {{i}} substituted

Examples

@for:0..4{
    point(x: {{i}}; y: {{i}})
}
@for(n: 1..3; as: k){
    Attempt {{k}} of 3.
}
On this page
AttributesExamples
For · Internote