So, I began with example code like this:
Code: Select all
[msrUpdate]
Measure=Calc
UpdateDivider=-1
DynamicVariables=1
Formula=-1
IfConditionMode=1
ifCondition=(#CURRENTSECTION#>=1) && (#CURRENTSECTION#<=10)
IfTrueAction=[!SetOption mtrLED[&#CURRENTSECTION#] X "#penLED[&#CURRENTSECTION#]X#"][!SetOption mtrLED[&#CURRENTSECTION#] Y "#penLED[&#CURRENTSECTION#]Y#"][!UpdateMeasure #CURRENTSECTION#]
ifCondition2=#CURRENTSECTION#=11
IfTrueAction2=[!SetVariable LEDShape "#penLEDShape#"][!UpdateMeasure #CURRENTSECTION#]
ifCondition3=#CURRENTSECTION#=-1
IfTrueAction3=[!SetOption #CURRENTSECTION# Formula "(#CURRENTSECTION#+1)%12"][!UpdateMeasure #CURRENTSECTION#]
On the eleventh iteration, it sets the shape variable used by those meters. The twelfth iteration stops the loop. This all worked as expected.
Next, variations were added by using nested variables, so that the X,Y coordinates, as well as the shape, could be changed based on a pendulum name. So the shape, rather than being static, would be:
[!SetVariable LEDShape "#pen#pendulumName#LEDShape#"]
and the coordinates would be:
[!SetOption mtrLED[&#CURRENTSECTION#] X "#pen#pendulumName#LED[&#CURRENTSECTION#]X#"]
Those of course don't work. But there are nesting forms of the variables which do work. Experimentation showed that:
[!SetVariable LEDShape "#pen[#pendulumName]LEDShape#"]
where just the added "pendulumName" portion used the nesting form, did not work. What did work was using the nested form for all parts:
[!SetVariable LEDShape "[#pen[#pendulumName]LEDShape]"]
But strangely, for the coordinate options, simply using the nested form on the added pendulumName portion was sufficient:
[!SetOption mtrLED[&#CURRENTSECTION#] X "#pen[#pendulumName]LED[&#CURRENTSECTION#]X#"]
This works, without having to use the nested form on the entire variable.
The net result is that simply by setting a name variable and updating this measure, one can set all of the positions and shapes for a group of meters, to one of many variations. In fact, the eleventh iteration can set not only the shape, but also borders, colours, and many other parameters as well.
Now the question is this: why does one variable need nested versions for all portions, while another needs the nested version for only a single portion?