Hello,

>> I need to build a condition with nested if-s, but I cannot get it work:
>>
>>      defer   condition     = ${if  and { \
>>                                            { \
>>                                                    ${if eq{}{} \
>>                                                    {true} \
>>                                                    {false} } \
>>                                            } \
>>                                            {eq{}{}} \
>>                                    } \
>>                               }
>
> You can't put the ${if inside there.  What you_can_
> do is put "eq {} {}" there - which evaluates to a truth-value,
> which is part of the "and".

but as I explained: This doesn't work for me. I need nested conditions. 
You cannot replace something like

if (whatever) {
        if (somewhat) {
                return true;
        } else {
                if (something) {
                        return true;
                } else {
                        return false;
                }
        }
} else {
        if (somewhat) {
                return true;
        } else {
                return false;
        }
}

by a simple and-condition.

The final logic in exim would be something like this:

${if  and { \
        { \
                ${if eq{}{} \
                        {true} \
                        { ${if eq{}{} \
                                {true} \
                                {false} \
                        } } \
                } } \
        } \
        { \
                ${if eq{}{} \
                        {true} \
                        { ${if eq{}{} \
                                {true} \
                                {false} \
                        } } \
                } } \
        } \
        } \
}

Since the above code does not work, I'm really interessed to see how 
else I can "and" these if conditions.

Kind regards
Marten

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to