Board Thread:Support Requests - Getting Technical/@comment-3361105-20140520221647

This question is going to be absurdly complicated, because the code that produces the error is absurdly complicated.

I've spent a great deal of the last four days working on a particular and elaborate series of templates, but when I finally tried to put them into practice on pages instead of testing them on my sandbox, I'm getting this error:

Expression error: Missing operand for >.

So, I searched and searched through all of the templates that I made for a > sign, and I tested out the variables from pages in the code that uses each instance of that operator's use - and it always worked without a hitch. So, I can't figure out why it's not working on pages.

That's the simple version.

Here's the more complicated version:

My template takes a given input date, and shoves the page that input comes from into a category that is called "Month Day, Year (Publication)", where "Day" is the nearest wednesday to the input date.

In order to do that, I've had to come up with an elaborate series of algorithms that calculate what day of the week a day was in the past, or will be in the future (FutureDOW and PastDOW).

Then, FPDOW chooses which of those two to use based on the input.

Then, DayCat does all of adding or subtracting the number of days required to hit the nearest wednesday, and adds the category.

All four of those templates use >, but I still can't figure out where the issue is.

What I have figured out, though, is that there is no problem when the input year is the current year or later.

That suggests to me that the problem is somewhere in FPDOW or PastDOW, where I've used the magic word 2024 a lot - but neither of them use > (they do use <, though).

DayCat and FutureDOW are the only ones that do use >, but both work when used on my sandbox, but the former doesn't when used on pages with a "Year" variable of less than 2014.

Are there any math geniuses/coding hawkeyes who can figure out why the heck years of 2013 or lower are giving me this expression error? 