[Jprogramming] Beg Q--Converting date row/column of boxed array

Sherlock, Ric R.G.Sherlock at massey.ac.nz
Tue Mar 4 05:58:53 HKT 2008


---Hahn, Harvey wrote:
> But when I try this, I get this (x is the date row in the boxed array):
>
>    xx =: x   NB. to "play it safe" with "x" and "y"
>    x2 =: 1&todayno &.> xx
> |domain error: todayno
> |   a=.0 100 100    #:a
>
> What's my problem?  Thanks!

todayno is expecting numeric y and I think you are giving it literals. You need to convert your dates to numeric before giving them to todayno.
   ]tst=. <;._1 '|20080102|20080104|20080106'
+--------+--------+--------+
|20080102|20080104|20080106|
+--------+--------+--------+
   1 todayno each tst
|domain error: todayno
|   a=.0 100 100    #:a
   ]tst=. _99&". each tst
+--------+--------+--------+
|20080102|20080104|20080106|
+--------+--------+--------+
   1 todayno each tst
+-----+-----+-----+
|75971|75973|75975|
+-----+-----+-----+


More information about the Programming mailing list