Having trouble with what would seem to be a simple if then expression
Hello all,
I'm trying to create a simple expression that will clamp an input based on another value. More specifically, I have a slider for a month input and a day input and I'm trying tp set up the "DAY" slider so that depending on what month is inputted in the MONTH slider, the DAY slider will only allow values that correspond to actual calendar values. E.g. if the MONTH slider is set to "2" (february) then if you put "32" for the DAY it'll just change it to "28". I wrote this expression but I have no idea what is wrong based on the error which is:
"Property or method named "A" in class 'global' does not exist or is missing. Any help is greatly appreciated!
Here is the code:
value = effect("MONTH")("Slider");
if (value == 1 || value == 3 || value == 5 || value == 7 || value == 8 || value == 10 || value == 12) {
A = 31;
} else if (value == 2) {
A = 28;
} else if (value == 4 || value == 6 || value == 9 || value == 11) {
A = 30;
}
Math.min(Math.max(effect("DAY")("Slider"), 1), A)
