Group Functions in DIAL
The group functions in DIAL define temporary focus groups for the current Models. The following functions are available.
Creates a new group and assigns it to the group stored in the special Object Variable group. The specified group is associated with the Model that is specified by the Model stored in the special Object Variable model, and contains values for the Dimension dimension_name. A new group is empty.
Returns whether the specified group is empty. If the group contains no values, this function returns true. Otherwise, it returns false.
Adds the specified dimension_value to the specified group. Duplicate values should not be added to a group. Accepts only one Dimension value at a time.
Returns the number of values in the group.
Returns the value in the group at the specified index. The index should be between 1 and the number of values in the group. The group is indexed based on the order that elements are added to the group.
Returns whether the specified group contains the specified dimension_value. If the group contains the dimension_value, this function returns true. Otherwise, it returns false.
NOTE: The groups referred to in this function are not Named Groups, but should be considered temporary Diver focus groups.
Group Functions Example
This script opens a Marker and creates a group of a few Dimension values. It saves a new Marker containing these Dimension values. The console then writes group members for verification testing only. The walk statement would be commented out during production. The console.writeln function ensures that there are no parsing errors.
diveline.connect("myserver","dial_user");
diveline.set_project("myProject");
marker.open(model, "region.mrk");
group.new(group, model, "Sales Region");
group.add(group, "North");
group.add(group, "Rhode Island");
group.add(group, "Boston");
marker.set_group(model, "Sales Region", group);
marker.save(model, "region_north.mrk");
walk (model,"Sales Region")
{
region = Dimension[Sales Region];
console.writeln(region);
}
console.writeln("Report Done!");
diveline.disconnect();