I’m currently getting an issue when trying to loop a counter (firefly component) as there is inevitably recursive data streams.
All I’m trying to do is create a loop - once the counter reaches the end it either reverses or starts at the beginning of the same list again, over and over, continuously. Does anyone know how to create a looped counter? Or, how to cycle through items in a list at specific time periods in a continuous loop?
Looking at the image of your code, I am confused… The content of the first panel on the left isn’t used, only the list length? No reason to flatten the output of Lng, and you can avoid the A-B component and its slider by using an expression on the Lng output (“x-1”). A very common pattern:
Hi, you are right, the information contained in the panel is not used in this example as I would use the output of the counter to go back and select items from the original list - should I get it to work. At present I can’t see how to reset the counter once it reaches a certain list item in that list though
I understand exactly what you mean @TomTom - this is elementary programming that goes WAY BACK, long before GH - but it must be mentioned that with Wrap List Item = true (the default), you get the same result without Modulus. I know you know that too, just saying…
This forum is a mix of issues that are very specific to GH, such as data trees and geometry, and issues like this (Modulus) that are fundamental to elementary programming in any language, from the earliest days.