Always snap to grid
Do...Until loop
The do...until loop is a loop construct similar to the while loop, but runs at least once.
Syntax[edit]
The syntax of the do...until loop is exactly what you would expect from its name:
do { ... } until (condition);
Note that UnrealScript doesn't "do...while", that means it loops until the condition is True. (or while it is False)
Like in any other loop construct you can use break and continue to exit the loop or jump to the next iteration.
Quirks[edit]
In Unreal Engine 1 and 2 the compiler wasn't too strict when checking the until statement. You could omit it, essentially creating an infinite loop that had to be exited with the break or return statement. This "feature" was removed in Unreal Engine 3.
A variation of the do...until loop is available in all engine generations. Like with the other loop constructs, you can specify a single statement instead of the code block after the keyword do:
do statement; until (condition);
Note that the statement needs to be terminated with a semicolon, similar to the non-block version of the If statement that requires a semicolon after its statement even if an else statement follows. It is strongly recommended to enclose even a single statement in curly braces to prevent potential misunderstandings and oversights.
Declarations | Preprocessor • Classes • Interfaces • Cpptext • Constants • Enums • Structs • Variables (Metadata) • Replication block • Operators • Delegates • Functions • States • Defaultproperties (Subobjects) |
---|---|
Types | bool • byte • float • int • name • string • Object • Class • Enums • Structs (Vector ⋅ Rotator ⋅ Quat ⋅ Color) • Static arrays • Dynamic arrays • Delegates • Typecasting |
Literals | Boolean • Float • Integer • Names • Objects (None ⋅ Self) • Vectors • Rotators • Strings |
Flow | GoTo • If • Assert • Return • Stop • Switch • While • Do...Until • For • ForEach • Break • Continue |
Specifiers | Super • Global • Static • Default • Const |
UnrealScript | Syntax • .UC • .UCI • .UPKG • Comments • #directives • Native |