How can I list an array but exclude the empty cells?

Get help using Construct 2

Post » Fri Sep 26, 2014 6:26 am

I would like to list the contents of an array on the x dimension but exclude the cells that are empty (0).

So if I have an array of words like this [Play] [0] [0] [Fire] when I display them this is what happens:

Play
0
0
Fire

What I need is:

Play
Fire

Thank you.
B
74
S
28
G
17
Posts: 256
Reputation: 15,125

Post » Fri Sep 26, 2014 6:32 am

If you're using loop, insert [condition: int(array.at(loopindex)) ≠ 0].
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Fri Sep 26, 2014 11:48 am

Thank you.
B
74
S
28
G
17
Posts: 256
Reputation: 15,125


Return to How do I....?

Who is online

Users browsing this forum: David181 and 11 guests