Scoping/loop question

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.
  • Hello!

    I have encountered a puzzling behaviour. The fix is easy enough but just wondering why, I guess

    I have a little function ("RowCount") that will go through each column of an array, and count the # of populated rows. I set it up to use a qualifer, which is filled with arrays, and it scopes the search using Instance Value of the array I want to check. So I can say, hey, check how many rows in column X=3 on layer Z=2 of array with instance value 4

    It works! But I have another strange issue.

    If I call this function from anywhere, and immediately after try to write to an array after, it won't do it. See below:

    Here I am grabbing a count of names from the relevant column of a preloaded array (Instance value 4), choose one at random, and slap it in another array. (ignore the child event,). But I need to count how many names are in the particular column, because each column could have a different number of names, so just taking the Y dimension of the array would result in some empty cells being potentially selected. If I put the writing action in a child event (checking some redundant condition) it works too.

    Don't make fun of my sweet icon art :D

    Please login to see this attachment.


    Here is "RowCount" function. Calling the array I want directly (locationNames array) works. Calling it by using the instance value and performing the check on the qualifier of arrays, still works, but prevents writing to the array after in the above screenshot

    Please login to see this attachment.

    I hope this makes sense, I am just wondering why using a qualifier prevents writing to the array after!

    Not really an issue, I am just used to trying to have as little code duplication as possible (a product of all the Powershell scripting I do at work I suppose :D)

  • I suspect this is what's happening:


    Please login to see this picture.


    Event #268 works because putting it in a new event forces Fusion to 're-remember' the scoping, with the new condition in #268. If you want to be extra certain that #268 will always scope the correct objects and only the correct objects, you might want to save the fixed value of the scoped objects in #267 (before you call the fastloop, when the scoping is not yet broken), and then scope for that fixed value in the conditions of #268.

    More info about scoping here: Please login to see this link.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

Participate now!

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