Reference/while

From Kx Wiki
Jump to: navigation, search

Contents

while (while control word)

Syntax

The while statement has the form:

while[test;exp1;...;expn]

where the test expression is evaluated and the result compared with zero. If not zero, the remaining expressions are evaluated in order. This is repeated as long as test is not zero. The test expression should return an atom.

while does not return a result.

Example

q)r:1 1
q)x:10
q)while[x-:1;r,:sum -2#r]
q)r
1 1 2 3 5 8 13 21 34 55 89

See also


For a complete list of functions, see the kdb+ Function Reference.

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox