assistance-engine/docs/developer.avapframework.com/chapter9_38.md

917 B

Control Flow Structures in AVAP

In AVAP, control flow structures include conditional statements and loops, which allow you to control the flow of execution based on conditions and iterate over a range of values.

If Statements

The syntax for an if statement in AVAP is:

if (variable, variableValue, comparator, expression)

                code to execute

                else()

                code to execute

                end()

This structure checks if the condition (variable compared to variableValue with the given comparator) is true, and if so, executes the block of code.

Loops

The syntax for a loop in AVAP is:

startLoop(variable, from, to) 
                code to execute 
                endLoop()

This structure initiates a loop where the variable iterates from the 'from' value to the 'to' value, executing the code block for each iteration.