How do I fetch multiple values from array?

Get help using Construct 2

Post » Fri Jan 01, 2016 3:31 pm

Hi!
I am working on a warehouse application and I am using an Array to store information.
I am having trouble retrieving all values from the y-axis of the Array. I have a search function where you can select a warehose row (x-axis of the Array) but when I try to retrieve all the Y-axis values of that row I only get the first one. Need help..
B
5
S
1
G
1
Posts: 15
Reputation: 841

Post » Fri Jan 01, 2016 4:42 pm

You will need to share a capx or upload a screenshot of your events so that we can take a look and see how we can help you out.
B
36
S
17
G
30
Posts: 679
Reputation: 19,254

Post » Fri Jan 01, 2016 6:34 pm

I'm no expert here but it sounds like a creating a function with a loop and two local variables might be something to consider. example (psuedo code):

on function "retrieve data"
local variable arrayX = (put the desired x value here)
local variable i = 0
while i < array.height
retrieve the value here at array(array.x,i)
i = i+1

then call the function "retrieve data" where you need it.
Again I'm no expert with little experience with arrays but maybe this helps a bit.
B
28
S
10
G
6
Posts: 251
Reputation: 6,655


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Kyatric, oddreal, oosyrag, waguilar and 3 guests