Option: -
In TDL Option is an attribute which can be
used by various definitions, to provide a conditional result in a program. The
‘Option’ attribute can be used in the ‘Menu’, ‘Form’, ‘Part’, ‘Line’, ‘Key’, ‘Field’,
‘Collection’, ‘Import File’ and ‘Import Object’ definitions.
Syntax
Where,
Option : Optional definition : Logical
Condition
If the ‘Logical’
value is set to TRUE, then the Optional definition becomes a part of the
original definition, and the attributes of the original definition are modified
based on this definition.
Example: -
If you want to add
the option in field the you can use following syntax.
[Field : FldMain]
Option : FldFirst : cond1
Option : FldSecond: cond2
The field FldFirst is activated when cond1 is true.
The field FldSecond is activated when cond2 is true. Optional
definitions are created with the symbol prefix "!" as follows:
[!Field : FldFirst]
[!Field : FldSecond]
Switch :
The ‘Switch - Case’ attribute is similar to the ‘Option’
attribute, but reduces the code complexity and improves the performance of the
TDL Program. The ‘Option’ attribute compulsorily evaluates all the conditions
for all the options provided in the description code, and applies only those
which satisfy the evaluation conditions. The attribute ‘Switch’ can be used in
scenarios where evaluation is carried out only till the first condition is
satisfied. Apart from this, ‘Switch’ statements can be grouped using a label.
Therefore, multiple switch groups can be created, and zero or one of the switch
cases could be applied from each group.
Syntax
Switch:
Label: Desc name : Condition
Example
[Field: Sample Switch]
Set as :
"Default Value"
Switch : Case1: Sample Switch1:
##SampleSwitch1
Switch : Case1: Sample Switch2:
##SampleSwitch2
Switch : Case1: Sample Switch3:
##SampleSwitch3
Switch : Case2: Sample Switch4:
##SampleSwitch4
Skip to main content