# For Each Unit In Unit Group Deprecated

Grammar — For each unit var in group do (Actions)
FlagsSubFunctions | Action

Runs the contained actions once for each unit in the unit group.

# Arguments

  • anyvariable — Unit
  • unitgroup — Unit Group

Returns — void

#AUTOVAR(g, unitgroup) = #PARAM(group);
#AUTOVAR(u) = 1;
for ( ; #AUTOVAR(u) <= UnitGroupCount(#AUTOVAR(g), c_unitCountAll) ; #AUTOVAR(u) += BoolToInt(#PARAM(var) == UnitGroupUnit(#AUTOVAR(g), #AUTOVAR(u))) ) {
    #PARAM(var) = UnitGroupUnit(#AUTOVAR(g), #AUTOVAR(u));
    #SUBFUNCS(actions)
}

Category: Unit Group / Loops

# Examples

— None found —