Command: gloop

Syntax

gloop { <elist> ... } {
    <command_block>
}

Description

Execute a set of commands on selected graphic primitives.

Parameters

Switches

Notes

The command block will be executed for each graphic primitive within <elist>. During each pass of the loop the system epointer this may be used to reference the relevant primitive.

A jump to the end of the loop may be made with the continue command.

Before execution of the command block, the entity list is checked to remove any entities which have null values, and multiple occurrences of the same graphic primitive.

A break out of the loop may be made with a break command. However when an exit is made from the loop then this reverts to the value it had at the beginning of the loop command, unless that value was null. This facilitates nested gloops.

Examples

Print the names and types of all primitives.

gloop {
    tell <this.gtype, ':', this.name>
}

Get the maximum radius of all circles in a group.

numeric radius
gloop group_a,-ef=circle_filter {
    radius = max(radius,this.radius)
}

See Also

Commands:

filter, group, loop

Identifiers:

all (group), current_filter (filter), this (epointer)