-
Notifications
You must be signed in to change notification settings - Fork 1
iterate
Jip Claassens edited this page Aug 11, 2026
·
1 revision
MetaScript functions iterate
- iterate(iteration_names, template, init_expr_item)
iterate instantiates template once per entry of the string attribute iteration_names and chains the iterations: the first subitem of each instantiation (by convention currValue) receives as expression the previous iteration's nextValue (the first iteration receives the expression held by the string parameter init_expr_item). The result container also exposes lastValue: the nextValue of the final iteration.
unit<uint32> iters: nrofrows = 3 { attribute<string> name := 'it' + string(id(.)); }
parameter<string> init := 'uint32(0)';
Template step
{
parameter<uint32> currValue;
parameter<uint32> nextValue := currValue + uint32(1);
}
container res := iterate(iters/name, step, init);
res/lastValue results in 3.
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.