Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

While

The syntax for while loops is absurdly easy. All you need is the while keyword with some parenthesis and an expression.

while (<expression>) {
    // Do something? Maybe? If you want, I guess?
}

The only real requirement is that the expression type is a boolean. KSL will give you a nice error if you don’t. If this is a problem, you can always cast to a boolean.

while (bool'127) {
    // This loop will run forever (127 will always cast to true)
}