StartLoop() Statement The loop statement in AVAP™ allows you to execute a block of code repeatedly until a specific condition is met. Below is a detailed explanation of its syntax and functionality. 7.1 Syntax of the Loop Statement The full syntax of the loop statement in AVAP™ is as follows: startLoop(control, start, end) // Code block to repeat endLoop() This syntax consists of three main parts: control: This is the loop control variable used to track the progress of the loop. It is initialized with the starting value of the loop and is incremented with each iteration until it reaches the end value. start: This is the starting value of the loop. The loop begins at this value. end: This is the ending value of the loop. The loop terminates when the control variable reaches this value. 7.2 Functioning of the Loop Statement The loop statement in AVAP™ follows this execution process: The control variable control is initialized with the starting value specified in start. The loop condition is evaluated: while the value of control is less than or equal to the end value end, the code block within startLoop() is executed. If the value of control exceeds the end value, the loop terminates, and execution continues after endLoop(). In each iteration of the loop, the code block within startLoop() is executed, and the control variable control is automatically incremented by one. Once the control variable reaches or exceeds the end value end, the loop terminates, and execution continues after endLoop(). 7.3 Example of Use Below is an example of using the loop statement in AVAP™, along with a detailed explanation of each part of the code: // Loop Sample Use // Initialize the variable 'variable' with the value 5. addVar(variable,5) // Start the loop with the control variable 'control', ranging from 1 to 5. startLoop(control,1,5) // In each iteration of the loop, assign the current value of 'control' to the variable 'counter'. addVar(counter,$control) endLoop() // Add the final value of 'counter' to the API result. addResult(counter) 7.4 Result and Conclusions After executing the above code, the result returned by the API is as follows: { status , elapsed:0.01605510711669922, result: { counter:5 } } This result confirms that the execution was successful (status:true) and that the final value of counter is 5. In summary, the loop statement in AVAP™ provides an efficient way to execute a block of code repeatedly within a specified range. By automating tasks that require repetition, such as processing a list of items or generating sequential numbers, this statement becomes a fundamental tool for programming in AVAP™.