How do I Determine an array element is empty and add value

Get help using Construct 2

Post » Fri Mar 28, 2014 12:18 am

Hi everyone!

I have ran into a problem, I am trying to add a value to the X axis of an array, I want to add this value to the next empty element inside the array.

Example: Each X element is marked a "[]"

How could I add a value to the 4th element where it is blank?

[11321][127556][456546545][BLANK][BLANK][BLANK][BLANK][BLANK]

I know how to insert values into the array if they are fixed, but what if this array is dynamic? After some values have been inserted.

Summary:

How do I add a value to the NEXT AVAILABLE blank array element.





Thank you
B
18
S
6
Posts: 348
Reputation: 2,633

Post » Fri Mar 28, 2014 7:41 pm

Can you start with an array of width 0 and just push new values onto the end of it? Or do you need those blank elements in there?
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Sat Mar 29, 2014 1:48 am

ramones wrote:Can you start with an array of width 0 and just push new values onto the end of it? Or do you need those blank elements in there?


I already had a system working but was much more complicated than what you had suggested, so I went with your idea. Much more simple. Thank you. :)
B
18
S
6
Posts: 348
Reputation: 2,633


Return to How do I....?

Who is online

Users browsing this forum: Christmas, Kyatric and 51 guests