I'm not so sure what you are asking but:
temp=. i. 5 5
[temp=. temp, temp
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
[thekey=. ({. "1 temp)
0 5 10 15 20 0 5 10 15 20
test=: 3 : 0
smoutput y
smoutput 'key: ', ": ~. {. "1 y
smoutput '---------------------------------------------------------'
)
Then press CTRL+W to load it and run the following:
thekey test /. temp
0 1 2 3 4
0 1 2 3 4
key: 0
---------------------------------------------------------
5 6 7 8 9
5 6 7 8 9
key: 5
---------------------------------------------------------
10 11 12 13 14
10 11 12 13 14
key: 10
---------------------------------------------------------
15 16 17 18 19
15 16 17 18 19
key: 15
---------------------------------------------------------
20 21 22 23 24
20 21 22 23 24
key: 20
---------------------------------------------------------
Basically, the verb 'test' is getting the values from temp. Since my
sample is that the key is the first column ... you can then just
"resolve" the key. :P
Somebody may have better idea though. ;)
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saunders, John
(HEALTH)
Sent: Monday, October 27, 2008 1:15 PM
To: Programming forum
Subject: [Jprogramming] using key value in u for x u/. y
Hi guys how do I reference the value of the key in the verb u when using
x u/. y
thanks
John
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm