do Loop

From NWN Lexicon
Revision as of 22:55, 22 August 2015 by Squatting Monk (talk | contribs) (Prettified article formatting.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The statements within a do code block are executed and then the condition of the loop is evaluated. This ensures that the statements will execute at least once. If the condition evaluates to FALSE the loop will halt.

// prototype
// do { statement; } while (expression);

// actual use
int i;
} while (i < 5);

 author: Ryan Hunt, editors: Charles Feduke, Mistress, contributor: Ken Cotterill