Tuto WINDEV 25

Part 2: The WLanguage basics 67 For example: Counter is int Counter = 10 LOOP // Process to run Counter = Counter - 1 IF Counter = 0 THEN BREAK END Tip The LOOP statement and the FOR statement can have the same behavior: all you have to do is use the syntax with exit according to the number of iterations: LOOP (<Number of iterations>) ... END Example: LOOP(10) // Process to run END The WHILE statement The WHILE statement and the LOOP statement operate according to the same principle. The difference is that the test of exit condition is performed BEFORE running the loop code. This test is used to compare a variable. This variable starts from a start value and it is modified in the loop until it reaches the value that triggers the exit from the loop. The syntax of WHILE statement is as follows: <Initialize the variable to its start value> WHILE <Compare the variable to its end value> Process to run <Modify the variable> END For example: Counter is int Counter = 0 WHILE Counter<10 // Process to run Counter = Counter + 1 END

RkJQdWJsaXNoZXIy NDQ0OA==