I’m trying to send data from a variable update over a handle so that changes can be reflected in a GUI.
I want .z.vs to send only the data that has been updated, by using i to index value v. This doesn’t seem to work when trying to index a single value in a matrix, and probably won’t for more nested structures, since i is a single list, and only indexes the variable as a single list. i.e:
q)M:4 4 # til 16
q)M
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
q).z.vs: {[v;i] show v,i,(value v)i} /example trigger, to show current indexing
q)M[1;2]:77
`M /the name of the variable
1 / the values in i
2 /
4 5 77 7 /this is M[1 2], instead of M[1;2], which is what I want
8 9 10 11
How do I index v recursively using each value in i? Where the first value is used to index v, and the next value is used to index the data gained from the last indexing.
e.g.
i = (1;2)
value v = M (as above)
So the first index would be:
a: M[i[0]] = 4 5 6 7
And the next:
a: a[i[1]] = 6
And THIS value is sent over the handle.
I could do this as a loop, but I want to avoid loops in q.