`show$`v show variable v `hide$`v hide variable v
C:\>k K 3.1 2004-01-28 Copyright (C) 1993-2004 Kx Systems WIN32 2CPU 4030MB ws-1341.x.com 0 EVAL a:10 _draw 100 / list a 20 51 12 34 31 51 29 35 17 89 `show$`a
a 20 51 12 34 31 51 29 135 17 89
a:(10 10000000) _draw 100 / 10 10 `show$`a
t:.((`a;10 _draw 100;);(`b;10 _draw 100)) `show$`t
val:10 val..l:"Input field" `show$`val
Display attributes (for variables that have class). x width integer(KFONT width) y height integer(KFONT height) a arrangement nest of symbols(class `form) o options list of symbols(class `radio) l label string kl click label string (also klr) Data-display attributes (for variables that have class `data). functions (monadic, constant or array) default e editable 0 or 1 1 f format string from data 11$(11.2$) g getdata data from string 0$ etc. u update update[old;new] : fg foreground integer(rrggbb) 0 bg background integer(rrggbb) -1(808080) expressions/events (strings) ins, del, f1 ... f12, ctrl_a ... ctrl_z k, kr, kk click, click right, double click(precludes e) c class(display) symbol `data(default) atom, list, dict, list of lists, dict of lists `chart as above where atom is list of y values `plot as above where atom is matrix of (x;y) values `check 0 or 1 `radio symbol (one of ..o; see below) `button expression or dictionary of expressions `form dictionary of entries of any class(incl. `form)
\d form val:100 incr:"val+:1" incr..l:"Increment" decr:"val-:1" decr..l:"Decrement" incr..c: decr..c: `button \d ^ form / - . .((`val;100;) (`incr "val+:1" .((`l;"Increment";) (`c;`button;))) (`decr "val-:1" .((`l;"Decrement";) (`c;`button;))))
form..a:`incr`val`decr form.val..e:0 / .
form.incr10:"val+:10" form.decr10:"val-:10" form.incr10..c : form.decr10..c: `button form..a:(,`incr;`decr10`val`incr10;,`decr) form..a (,`incr `decr10 `val `incr10 ,`decr)
calc..a:(`exp `va`vb`vc`vd `n0`n1`n2`n3 `n4`n5`n6`n7 `n8`n9`lp`rp `fa`fs`fm`fd`fe `eval`clear) / calc:@[_n;1_-1_ calc..a;:[;"exp,:(~_v)`l"]] / expressions calc[.;`l]:"abcd0123456789()+-*%:" / labels calc.eval:"exp:5:. exp" calc.clear:"exp:\"\"" calc[.;`c]:`button calc.exp:calc.exp..l:"" `show$`calc
p..c:`chart p:(5 5) _draw 100 `show$`p
`show$.,((`p;({[x] (2 30)_draw 30}'!10);.,(`c;`plot;)))
d:10 _draw 10 w:!0 / empty client list .mg:{w,:_w;d} / return data .mc:"w@:&~w=_w" / retain clients .ms:{. x;w 3:\:x;} / (log `l 5:,x) apply and broadcast \mi 1 listen on port 1
h:3:(`;1) / connect to server d:h 4:_n / get database d..t:"if[0=_w;h 3:(_v;_i;:;_v ._i)]" / send my updates `show$`d
Source: https://habr.com/ru/post/205844/
All Articles