How Is a While Loop Different From a Do Until Loop in GML?

In GameMaker Language — and in most programming languages — the difference comes down to when the condition is checked.

While Loops Check First

A while loop evaluates its condition before running anything. If the condition is false to begin with, the body never executes.

while (false) {
  // this code never runs
}

Do Until Loops Check Last

A do ... until loop runs its body first and checks afterwards, so the code always executes at least once.

do {
  // this runs exactly once
} until (false);

In that second example the condition is false, so the loop body runs one time and then exits.

The practical rule: use a while loop when the loop should possibly do nothing at all, and a do until loop when the action must happen once before any condition matters — reading input, drawing a frame, or prompting a player, for instance.