I explained escaped variables to sl23 not long ago but maybe that explanation won't apply here, so, here's another attempt to explain it.But I have a question. How should this be understood? We have not replaced the value of #ScaleX# but we have kept the value of #ScaleX#?
Variables have two syntaxes, #Normal# and [#Nested], and both can be escaped: #*Normal*# and [#*Nested*].
The difference between the normal and nested syntax and escaped is , as explained by Yincognito:
So, in short, in your case, when you use #ScaleX#, you are using the inmediate value of the ScaleX variable, when you use [#*ScaleX*], you are using the #ScaleX# variable directly, which remains dynamic.I use:
a) standard #variable# in normal circumstances
b) nested [#variable] when:
- nesting variables within other variables
- needing the value just changed by a bang in the same option
- forcing dynamic behavior in places not supporting dynamic variables
c) escaped #*variable*# when using the value isn't desired yet
d) escaped nested [#*variable*] when:
- nesting escaped variable names
- using nested variable names within other variables in [Variables]
- using multiple escaping levels like [#**variable**] in [Variables]
I don't use the nested syntax everywhere for two reasons:
- performance: it forces dynamic behavior in that section
- clarity: when used it makes clear that it is actually needed
A visual way to put it: You're using SetOption bang, which sets the X option in the SliderRed meter, so this:
Code:
[!SetOption SliderRed X "(Clamp(($MouseX$ / #ScaleX#),(135),(175)) * #ScaleX#)"]
Code:
[SliderRed]..X = (Clamp((125),(135),(175)) * 1)
and this:
Code:
[!SetOption SliderRed X "(Clamp(($MouseX$ / #ScaleX#),(135),(175)) * [#*ScaleX*])"]
Code:
[SliderRed]..X = (Clamp((125),(135),(175)) * [#ScaleX])
for instance this:
Code:
[!SetOption SliderRed X "(Clamp(($*MouseX*$ / [#*ScaleX*]),(135),(175)) * [#*ScaleX*])"]
Code:
[SliderRed]..X=(Clamp(($MouseX$ / [#ScaleX]),(135),(175)) * [#ScaleX])
Statistics: Posted by RicardoTM — Today, 7:38 pm