best way to check a loop has finished?

Post » Thu Mar 30, 2017 11:00 am

Is there an easy way to check if a foreach loop has finished?

I can't see a way to detect it, so I've simply made a random event, stuck some actions inside it I want done after it and then removed the event so it's a blank event with actions, which seems to work. It feels a little weird to need to do that though, so hopefully I'm missing something.
B
4
S
2
G
5
Posts: 346
Reputation: 2,417

Post » Thu Mar 30, 2017 11:27 am

The loop will finish 'in place'. In the same tick, prolonging the tick if needed.

Hence, it is (just) ready in the next event.

Loop event
_____bunch of actions

Next event .... loop is ready
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Mar 30, 2017 11:34 am

I solved that issue by comparing loopindex:

| Global number endofloop = 10
+ System: For "" from 1 to endofloop


----+ System: LoopIndex = endofloop
-----> Text: Set text to "Do stuff here"

(Well, it seems that the copy as text function works just fine).
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests