3.18

@@IncludeIf/@@End

Use the @@IncludeIf/@@End statement pair to include material only when a specific condition is met. You can include multiple tests within an @@IncludeIf using the @@ElseIf and @@Else statements within the @@IncludeIf/@@End pair. @@ElseIf and @@Else statements are processed in order.

Syntax:

@@IncludeIf(<test>)

content when test is true

@@ElseIf(<test>)

content when the previous test is false but this test is true

@@Else

content when all tests are false

@@End

Parameters:

<test>

The condition you are testing for. You can test on a token.

When testing on a string (non-numeric value), enclose the data in single quotes. When testing on a number, do not use single quotes.

Use Or and And for testing multiple conditions. Or evaluates to true when any of the conditions are true. And evaluates to true only when all of the conditions are true.

You can use any of the following test conditions

=

equals

<>

does not equal

<

less than (only allowed with numeric data)

>

greater than (only allowed with numeric data)

 

Examples:

Example 1

Include the content if the token #MDSLPolicy.AccountState is equal to GA.

@@IncludeIf(#MDSLPolicy.AccountState = 'GA')

Some content.

@@End

Example 2

Include the content if account state is GA or CO or CA.

@@IncludeIf(#MDSLPolicy.AccountState = ‘GA’ Or #MDSLPolicy.AccountState = ‘CO’ Or #MDSLPolicy.AccountState = ‘CA’)

Some content.

@@End

Example 3

Include the content only when account state is GA and account city is Atlanta.

@@IncludeIf(#MDSLPolicy.AccountState = ‘GA’ And #MDSLPolicy.AccountCity = ‘Atlanta’)

Some content.

@@End

Example 4

Include different content when state is GA or CA or when neither is GA nor CA.

@@IncludeIf(#MDSLPolicy.AccountState = ‘GA’)

Content when the state is GA

@@ElseIf(#MDSLPolicy.AccountState = ‘CA’)

Content when the state is CA

@@Else

Content when state is neither GA nor CA

@@End