Re: [exim] problem with ${if } in nested and {} condition

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] problem with ${if } in nested and {} condition
On 02/18/2010 10:32 PM, Marten Lehmann wrote:
> 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;
>     }
> }


   ${if whatever                         \
            {  ${if   somewhat          \
                          {yes}                                \
                          { ${if       something } }    \
            }                                     \
            {  ${if   somewhat  }      \
      }


Obviously, replace "whatever", "somewhat" and "something" with
suitable conditions ( per http://exim.org/exim-html-4.69/doc/html/spec_html/index.html#toc0144 ).
I wasn't sure if you meant the two "somewhat"s to be the same....
and I used the "syntactic sugar" of assumed "yes" and "no" results.

Now, re-reading your original, I'm unsure where your "and" comes in?
Perhaps it's implied by the embedding.

Cheers,
     Jeremy