// Pretend that the following code is somewhere within a function.
local unit temporaryUnit
// Enumerate units and everything else...
set temporaryUnit = FirstOfGroup(someGroup) // Pretend that the group is filled with units.
exitwhen (temporaryUnit == null)
// Do stuff with the "temporaryUnit" unit.
call GroupRemoveUnit(someGroup, temporaryUnit) //You forgot this bit