Evaluates an expression while the condition is non-zero.
WHILE(expr, statements)
WHILE (expr) { statements; }
expr |
- |
Any valid expression that evaluates to a scalar. |
statements |
- |
Any valid statements separated by semicolons to evaluate while expr is non-zero. |
Result of statements.
differentiates the current Window until the maximum value is greater than 10.0
multiplies variable a by 2 until the resulting value is greater than 25.
same as above, except in SPL form.
W2 displays a remarkably simple demonstration of aliasing errors due to undersampling the sinewave in W1.
See LOOP for a faster but less flexible iteration construct.
For best performance, try to avoid loops altogether by exploiting the vectorized nature of SPL. For example:
can be performed much faster, more intuitively and concisely with:
or even faster with: