Reference/if

From Kx Wiki
Revision as of 05:14, 27 June 2011 by Chris Burke (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

if (if control word)

Syntax

The if statement has the form:

if[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. The test expression should return an atom.

if does not return a result.

Example

q)a:100
q)r:""
q)if[a>10;a:20;r:"true"]
q)a
20
q)r
"true"

See also


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

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox