WEND is a keyword used in the ProBuilder programming language to mark the end of a WHILE loop. The WHILE loop repeatedly executes a block of code as long as a specified condition remains true. The WEND statement signifies the point at which the loop should evaluate the condition again to decide whether to continue executing or to exit the loop.
WHILE condition DO
[statements]
WEND
i = 0
Count = 0
WHILE i <> 11 DO
i = i + 1
Count = Count + 1
WEND
RETURN Count
In this example, the WHILE loop starts with i initialized to 0. The loop continues to execute as long as i is not equal to 11. Inside the loop, i is incremented by 1 in each iteration, and the Count variable is also incremented by 1. Once i reaches 11, the condition i <> 11 becomes false, and the loop terminates with the WEND statement. The final value of Count, which is 11, is then returned.