{if DOCUMENT.TREE1 ="" and DOCUMENT.TREE2 >"0" and DOCUMENT.TREE3 >"0" and DOCUMENT.NID1 ="N" and DOCUMENT.NID18 ="S" and DOCUMENT.TREE2 == DOCUMENT.TREE3 then FMT("Tree:","B") +hret + FMT("\t Tree has not changed.","") +hret else ""}
What should be happening is if tree 2 and tree 3 have the same values then the text should display, but if they are differing then nothing should display.
This code works just fine for another variation...kinda stumped. What am i doing wrong?
if DOCUMENT.NID1 ="S" and DOCUMENT.NID18 ="S" and DOCUMENT.TREE1 = DOCUMENT.TREE2 and DOCUMENT.TREE1 = DOCUMENT.TREE3 then FMT("Tree:","B") +hret + FMT("\t Tree has not changed.","") +hret else
first off...when doing comparisons of equality, use ==, not =.
second...if comparing 2 to 3, why are you comparing other variables?
third...when comparing numeric values, use VAL(variable) comparison operator number/VAL(string/variable).
hope this helps.
did you try removing one of the == signs between .tree2 and .tree3. don't know if thats the issue but its worth a try.
jjordet said:
first off...when doing comparisons of equality, use ==, not =.
second...if comparing 2 to 3, why are you comparing other variables?
third...when comparing numeric values, use VAL(variable) comparison operator number/VAL(string/variable).
hope this helps.
1. I've tried both and it didn't make a difference.
2. Due to the form, those other fields need to be that way and that way only, kind of a safety measure of sorts.
3. I did try switching to VAL(DOCUMENT.TREE2) == VAL(DOCUMENT.TREE3) but that didn't work. Is that what you were meaning? Not sure what you meant by "number/VAL(string/variable)"
how about endif? i didn't see one at the end of your formula?
correct.
and good catch on the endif, should be one at the end.
jjordet said:
correct.
and good catch on the endif, should be one at the end.
The endif is there, there was an additional statement after it that I removed.
Interestingly enough, if I just use this code:
{if DOCUMENT.TREE1 ="" and DOCUMENT.TREE2 >"0" and DOCUMENT.TREE3 >"0" and DOCUMENT.NID1 ="N" and DOCUMENT.NID18 ="S" and VAL(DOCUMENT.TREE2) == VAL(DOCUMENT.TREE3) then FMT("Tree:","B") +hret + FMT("\t Tree has not changed.","") +hret else "" endif}
It works as intended, but if I toss it in with the couple of other if then statements it doesn't work, and it's the only one that doesn't work...