MOD() Divisor as Variable

Hi Guys,

Is there a way to make the Divisor in the MOD() function a variable, eg

Var1 = 10;
Var2 = MOD(HIGH(), Value = Var1);   // this produces "Please enter a valid script..." message
or
Var2 = MOD(HIGH(), Var1);          // this does NOT produce the "Please enter a valid script..." message

From my testing neither version of Var2 works, unless the Var1 in the MOD() is replaced with a number.

I intend calculating Var1 based on chart conditions to save having to create multiple scripts with just with divisor changed. (I’ve got way too many scripts like that already☹ )

Also, if it can be set as a variable it can be made a script property that can be changed without having to open the Script Editor☺

Looking forward to a solution.

Cheers

Trevor

 

Hi Trevor,

No, unfortunately we never built that and with our current development schedule, I can see no solution within at least 18 months.

All the best

Mathew

Thanks Mathew,

It would be good if most script function properties s could accept variables as well as numbers. Might be something to keep in mind when creating new functions and updating existing ones.

Cheers

Trevor