2026-05-04 / 4 min read
Choosing between FOR, WHILE, and REPEAT UNTIL
Learn a simple decision rule for picking the right pseudocode loop structure.
LoopsControl flowSyntax
Known count means FOR
When you know exactly how many values, rows, or attempts you need to process, a FOR loop communicates that intent clearly.
Unknown count means condition loops
Use WHILE when the condition must be checked before the first run. Use REPEAT UNTIL when the prompt or action must happen at least once.