Page MenuHomeFeedback Tracker

<b>select [<i>index</i>]</b> (select subset) does not work on arrays
Closed, ResolvedPublic

Description

Omitting the end index when sub selecting from an array, the result is always an empty array.

As opposed to sub selecting from strings, the end index is mandatory when sub selecting from arrays.

Details

Legacy ID
3450691012
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Scripting
Steps To Reproduce

_str = "Hello World!";
hintSilent (_str select [3]); //"lo World!"

_arr = ["hello", "world", "you", "are", "wonderful"];
hintSilent str (_arr select [2]); []
hintSilent str (_arr select [2, count _arr]);
["you", "are", "wonderful"]

Event Timeline

HereisJohnny set Category to Scripting.
HereisJohnny set Reproducibility to Always.
HereisJohnny set Severity to None.
HereisJohnny set Resolution to No Bug.
HereisJohnny set Legacy ID to 3450691012.May 8 2016, 12:32 PM
Adam added a comment.Aug 21 2015, 9:16 AM

Not supposed to work on arrays. Only strings are supported.

Thank you for your feedback.

Hmm, I just reckoned, if something works by 90%, why not implement the remaining 10%? I know it's a common uninformed phrase, but <i>shouldn't be that hard</i> in this case, is it?

Thanks anyway for your consideration.