IF [ARRAY] not found value THEN -> set text not found value

Get help using Construct 2

Post » Mon Oct 05, 2015 4:17 am

I cant find any question like this in the forum or a tutorial, maybe this cant be done by the way that i am thinking, i have a loop like you can see in the image, if the array contains the value 0 in Y7 then -> action, but my other events modify the array Y7 value then sometimes my array will not contain the 0 value in Y7, i want that when i call the function if the value 0 isn't in the array then set text: value not found, i have different values in the array that change with the other events then i cant use a specific value to do this.

Image
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Mon Oct 05, 2015 4:27 am

It sounds as if an else would do this.
Image
But I'm not sure I understand what you mean.
Edit: Like this, I mean:
Image
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Mon Oct 05, 2015 4:41 am

Sumyjkl wrote:It sounds as if an else would do this.
Image
But I'm not sure I understand what you mean.
Edit: Like this, I mean:
Image


i tried else and didn't work, i just want if the array not found 0 value then set text value not found.

Image
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Mon Oct 05, 2015 4:58 am



Turns out, the array needed to be larger than the scope. The array width, height etc. are not zero based. They are the count of the number of entries on that dimension.
If your array height is 7, try making it 8.

This worked:
Image
The capx I used: [mediafire]
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Mon Oct 05, 2015 2:14 pm

Sumyjkl wrote:


Turns out, the array needed to be larger than the scope. The array width, height etc. are not zero based. They are the count of the number of entries on that dimension.
If your array height is 7, try making it 8.

This worked:
Image
The capx I used: [mediafire]


I recheck the capx, i think is working now, thank you so much!
B
9
S
3
Posts: 142
Reputation: 1,108


Return to How do I....?

Who is online

Users browsing this forum: Apollo14, ChoosyZerk and 54 guests