[[modding:function:loop]] === loop === [[modding:function:loop]] ^ Syntax | (loop condition exp) -> value of last expression | ^ Arguments | condition: The function keeps on running as long as the condition is not Nil. | ^ | exp: The expression you want to evaluate as long as the condition is not Nil. | ^ Returns | Whatever the last evaluated expression returns. | ^ Category | [[iteration functions|iteration]] | ^ Description | Evaluates the expression over and over until the condition is Nil. The expression will never be evaluated if the condition starts as Nil. | === Example === (block (number) (setq number 1) (loop (ls number 5) (block Nil (setq number (add 1 number)) (dbgOutput number) "yay" ) ) ) Displays on the debug console. 2 3 4 5 Returns the string yay. Return to [[:Functions]] list