Page MenuHomeFeedback Tracker

count instead of foreach not works now
Closed, ResolvedPublic


A lot of modes use count instead of foreach, like here:

But now count block is required to return boolean, and it breaks a lot of code.


Legacy ID
No Bug
Steps To Reproduce

b = []; {b pushBack _x} count allUnits

Additional Information

works if
b = []; {b pushBack _x; false} count allUnitsUAV

Event Timeline

nkey edited Steps To Reproduce. (Show Details)Oct 14 2014, 11:19 PM
nkey edited Additional Information. (Show Details)
nkey set Category to Scripting.
nkey set Reproducibility to Always.
nkey set Severity to None.
nkey set Resolution to No Bug.
nkey set Legacy ID to 119087274.May 7 2016, 7:36 PM

It is not the count. pushBack has been expanded and returns the index of last element inserted, which is Number, and count expects either Nothing or Boolean.

b = []; {0 = b pushBack _x} count allUnits

assigning result of pushBack to 0 will make it return nothing.

nkey added a subscriber: nkey.May 7 2016, 7:36 PM
nkey added a comment.Oct 14 2014, 11:59 PM

OK, now I see.
Thanks for info.

Gundy added a subscriber: Gundy.May 7 2016, 7:36 PM

Thanks KK, I was just stumbling over this one as well...

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums ( if you feel your bug was closed in error.