How do I detect the first empty space in an array ?

Get help using Construct 2

Post » Mon Nov 17, 2014 10:34 am

Hello,

I am a beginner with arrays, so I apologize if my question seems obvious. I think it is a very a simple one:

I have a one-dimension array, it looks like this

0 : "boat"
1: 0
2: "tank"
3: "plane"
4 : "infantry"

And I just want to create a condition that checks if this array contains an empty slot (in this exemple, this is the slot 1), to create some event accordingly.
How would you do that ?

Thanks :)
B
6
S
2
Posts: 32
Reputation: 575

Post » Mon Nov 17, 2014 11:13 am

Here's an example for you.

firstemptyxindex.capx
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon Nov 17, 2014 10:39 pm

Thank you very much :)
B
6
S
2
Posts: 32
Reputation: 575


Return to How do I....?

Who is online

Users browsing this forum: dop2000, tarek2 and 5 guests