It's just different syntax combinations
My solution holds true to another situation, however from your question I was mislead to believe that near and far were engine predefined (Not user defined).
"near" and "far" are some kind of undocumented reserved words
I just attempted to find them in the manual and can't find them - which suggests to me that you are defining those vars which nulls my first post.
That is indeed a strange error since that should work if you're defining them.
What if you made those variables global instead of local? still get an error like that?