Array and "on each" loop

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • The 'on each' condition is for the regular 'for each' loop, i.e. If you have multiple array objects and you wanted to loop through each instance of array objects themself and scope them individually

    A regular fast loop should let you loop through an array, then you can stop the loop when it finds an empty slot. Something like this might be what you're after:
    Please login to see this picture.

  • The 'on each' condition is for the regular 'for each' loop, i.e. If you have multiple array objects and you wanted to loop through each instance of array objects themself and scope them individually

    A regular fast loop should let you loop through an array, then you can stop the loop when it finds an empty slot. Something like this might be what you're after:

    Thank you so much for explaining it. I appreciate it a lot. :)

    ~Tiny~

  • I have tested the loop solution but am still doing something wrong because I can not "catch" which loop the loop stopped at. I need the number so I can place object at the correct place and save to that slot in the array.

    Tried so far.
    1. Added it to my own project with the condition but could not retrieve the loop number.
    2. Made a new test app where I did it exactly as your example but still no go.
    3. Tested with no condition and then I would get the end loop number. So at least the loop is looping. :)

    Here is the test app. Load slots in the array with the button first to fill slots. Slot #3 is 0.

  • Ah, sorry I assumed index 0 for the array and not index 1 - the loop would have been terminating early since it was trying to find a value that didn't exist and would return 0

    changing every instance of 'loopindex("check_empty")' to 'loopindex("check_empty")+1' should fix it

    Please login to see this attachment.

    (I had to remove the binary data for it to work on my computer since I didn't have the local file)

  • Ah, sorry I assumed index 0 for the array and not index 1 - the loop would have been terminating early since it was trying to find a value that didn't exist and would return 0

    changing every instance of 'loopindex("check_empty")' to 'loopindex("check_empty")+1' should fix it

    Please login to see this attachment.

    (I had to remove the binary data for it to work on my computer since I didn't have the local file)

    Thank you! Works perfectly now. :)
    I should have been able to figure that one out myself but brain is not what it used to be.

    ~Tiny~

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!