@@DefineIf/@@Else
Use the @@DefineIf / @@Else pair when you want to define a token based on a test condition. You can include @@ElseIf statements inside the @@DefineIf / @@Else pair to test additional conditions.
Syntax:
@@DefineIf(<test>) <token name> <definition>
@@ElseIf(<test>) <token name> <definition>
@@Else <token name> <definition>
Parameters:
The token will take the defined value when this test condition is true. A token can be part of the test.
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)
The name of the token you are creating.
Example:
@@DefineIf(#MDSLPolicy.AccountType = ‘CORP’) #Entity Corporation
@@ElseIf(#MDSLPolicy.AccountType = ‘PTRS’) #Entity Partnership
@@ElseIf(#MDSLPolicy.AccountType = ‘UNKN’) #Entity Unknown
@@Else #Entity None
Assigns #Entity the value of Corporation when AccountType is CORP, Partnership when AccountType is PTRS, Unknown when AccountType is UNKN, and None when Account Type is none of the tested values.