In the Scripting Language Documentation, the callback “On Variation(oldVariation,newVariation)” states: “Called when you switch to another variation”.
I want to use this callback to notify me when the variation changes. It is confusing to me because I don’t have parameters I can pass to it … I just want to be notified when the variation changes. Can I pass null parameters?
For example, I tried using this code. It is looking for parameters to be passed and obviously I received a compile error:
On Variation ()
The on variation callback has parameters which you can use or not.
You do not pass parameters to this callback as it is a callback which is called when a variation changes,
And the you can use the 2 parameters and do what you like.
Those “parameters” are not to be provided from you - they are just values which are “delivered” each time the callback is triggered, and they have to be defined as the manual states - if you’ll need them or not.
So an empty bracket must not be used with this callback!
You’ll always get two integer values for “oldVariation and newVariation” from this callback.
However, that being said, I know you are trying to help - so, I need to compute a variable in my Scriptlet that cannot be a parameter in the scriptlet. … and therefore when variations are changed, the Scriptlet does not remember the value of a variable. it only remembers the value of a Scriptlet parameter.