As part of the code I would like to query whether the actual item i corresponds to item with real name “abcde”. So in the example of the above mentioned link we have items defined as
…and another question. From within the “forEach…” I would like to execute commands. Normally I would simply code this as follows:
myGroupname.members.forEach[ i |
if i == "vGarageOpener2_Timer" {
Thread::sleep(20000)
do_something_more...
}
else {
Thread::sleep(10000)
do_something_else...
}
]
What would you recommend to do in order to avoid the Thread::sleep? I would like to use a timer if possible. But the timer would only cause a cascade of “do something more” or “do something else” without waiting for completion of the respective do someting stuff.
… Which will then only delay the do_something_more but execute immediately the if else block for the next member of myGroupname. However the prerequisite is that the next member is not used until the previous timer ended or terminated.
Consider it like a cascade of lights, each light being assigned a switch of myGroupname. 1st light is turned on and after a timer of 10 seconds turned off. Only thereafter the 2nd light is turned on, timer 10secs, turn off. And so on.