I'm trying to write an #if
statement with a sequence of numbers. Basically, if a certain field matches any of a subset of numbers (shown below with ||
or operators) then assign it as "bayarea", elseif
a different subset, then a different name, etc. Is this possible without a bunch of nested "or" statements?
I'm getting a syntax error saying that it's expecting a boolean yes/no statement.
<#if TEST_CONTACTS_LIST.PREFERRED_STORE ==
{12||21||22||38||46||67||71||74||76||77||83||86||104||113||119||143>
{bayarea}
<#elseif TEST_CONTACTS_LIST.PREFERRED_STORE ==
{34||62||84||91||137||144||152||169}>
{blueridge}
<#elseif TEST_CONTACTS_LIST.PREFERRED_STORE ==
{18||44||49||50||61||68||121||182}>
{frontrange}
<#else>
</#if>
You don't need nesting:
Though that's surely too verbose, but you can do this:
But I think what you are looking for is this (or this combined with the
#assign
, if you have several#elseif
-s):This is a possibility too (just don't forget the
#break
-s):