Currently, if one wants to do various things in a FOR / WHILE loop, the preferred choice is to implement this in Lua. In plain Rainmeter code, it's possible too, but in a limited and "hacky" way, via a "self updating measure" that will update itself as long as some condition(s) are met and eventually cease updating itself and exit the "loop" once the said condition(s) are not met anymore, something like:
Code: Select all
[SomeMeasure]
Measure=...
...
IfCondition=(SomeConditionsThatKeepTheLoopRunning)
IfTrueAction=[DoWhateverStuffAndProgressTowardsNotMatchingTheAboveConditions][!UpdateMeasure SomeMeasure]
IfFalseAction=[OptionallyDoWhateverStuff]
IfConditionMode=1
DynamicVariables=1
So, my proposal is to have a dedicated measure to do that and in essence running whatever actions / bangs corresponding to an iteration as well as the loop itself from the internal C++ code (similar to how Lua is doing). The syntax of such a measure could be similar to the Script one or even the PowershellRM plugin or the ActionTimer one (by the way, can one do a FOR in an ActionTimer measure, how about a WHILE?):
Code: Select all
[WhileMeasure]
Measure=While
Actions=[StuffToDoDuringAnIterationHere]
While=(ConditionsToKeepIteratingHere)
...other possible options here...
P.S. I guess a plugin to introduce this would be fine too, it doesn't have to be included in the main distribution right away. Feel free to discuss this or come up with arguments for or against such an addition.