Announcement

Collapse
No announcement yet.

Anyway to use a foreach on the function return?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Anyway to use a foreach on the function return?

    So if I have a function that returns an array of a certain class, I could do something like this:
    Code:
    local Actor _actor;
    foreach MyFunctionThatReturnsAnArrayofActors()(_actor) {
        //do something with _actor;
    }
    This will return the compiler error:
    Code:
    Error, Cannot execute dynamic array iterator on the return value of a function
    It seems kinda annoying that I have to assign a local variable to hold the return value, before being able to use iterators on it.

    Wondering if there is some trick to get around this?

    #2
    Not that I know of. Just make the local variable to hold the return value, man.
    Check out Himeko Sutori, the upcoming tactical RPG where you control armies of over 100 unique characters.

    Comment

    Working...
    X