Skip to main content
Skip table of contents

Loop (DT)


Loop (DT)

A loop is formed in a decision table by calling the DT from itself. Then the condition part contains the criterion for exiting the loop. After the end of the loop, the ELSE rule goes into effect.

Example 1: DT "Loop" (loop structure)

 

 

R 01

ELSE

C 01

i

<= Max

 

C 02

 

 

 

A 01

...

 

 

...

 

 

 

A nn

p$Loop)

x

 


Please note:

·in this example the loop counter "i" must be initialized outside of the calling ET

·The loop call ("p$loop ()" in this example) must strictly be placed in the last action of the decision table. Otherwise, a large number of loops could cause a stack overflow. This also applies to "empty" actions at the end of the decision table.

Example 2: DT "Rebate". All prices in a list whose individual values ??are above 100 euros are reduced by 5%

 

 

R 01

R 02

ELSE

C 01

i <= PosSum

j

j

 

C 02

Price[i]

> 100

 

 

C 02

 

 

 

 

A 01

Price[i] =

Price[i] * 0.95

 

 

A 02

p$Discount()

x

x

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.