It is a lot easier since I entered the data as both numeric and character data
mixed! Here’s my lagest version. I still have to use Ric’s method of data
entry. Thanks. Linda
A=:1809;'Philip St. George Cooke';1895
B=:1807;'Rachel Cooke';1896
C=:1830;'John Eaten Cooke';1886
D=:1840;'Mary Frances Cooke';1878
E=:1833;'B Jeb Stuart';1864
F=:1836;'B Flora Cooke Stuart';1923
DA=:A,B,C,D,E,:F
age=: 13 :'-/"1(>"0)2 0{"1 y'
AGE=:<"0,.age DA
DAT=:DA,.AGE
M=:1830 1867 1855
MA=:<"0,.M
MAR=:2#M
DIF=: 3 2$(>2{"1 DA)-MAR
W=:<./"1 DIF
WE=:6 1$,,.MA,.<"0,.W
ALL=:DAT,.WE
[MATES=:3 2 5$,ALL
┌────┬───────────────────────┬────┬──┬────┐
│1809│Philip St. George Cooke│1895│86│1830│
├────┼───────────────────────┼────┼──┼────┤
│1807│Rachel Cooke │1896│89│65 │
└────┴───────────────────────┴────┴──┴────┘
┌────┬───────────────────────┬────┬──┬────┐
│1830│John Eaten Cooke │1886│56│1867│
├────┼───────────────────────┼────┼──┼────┤
│1840│Mary Frances Cooke │1878│38│11 │
└────┴───────────────────────┴────┴──┴────┘
┌────┬───────────────────────┬────┬──┬────┐
│1833│B Jeb Stuart │1864│31│1855│
├────┼───────────────────────┼────┼──┼────┤
│1836│B Flora Cooke Stuart │1923│87│9 │
└────┴───────────────────────┴────┴──┴────┘
Linda
-----Original Message-----
From: Programming [mailto:[email protected]] On Behalf
Of dhkelly
Sent: Monday, July 11, 2016 11:34 PM
To: [email protected]
Subject: Re: [Jprogramming] How long did the marriages last?
Just a question? Why treat dates as character strings?
A=:1809;'Philip St. George Cooke';1895 might simplify both entry and operations
on the dates. This is true of the previous age problem as well. Don Kelly
On 7/9/2016 7:19 PM, Linda A Alvord wrote:
> I have put married pairs together. The 4th column has the date for
> each of the three marriages. I can get the length of their marriages
> but I can't seem to insert them into the three boxes which currently
> contain a zero. I can't amend the three years in the boxes. Linda
>v
>
>
> A=:'1809';'Philip St. George Cooke';'1895'
>
> B=:'1807';'Rachel Cooke';'1896'
>
> C=:'1830';'John Eaten Cooke';'1886'
>
> D=:'1840';'Mary Frances Cooke';'1878'
>
> E=:'1833';'B Jeb Stuart';'1864'
>
> F=:'1836';'B Flora Cooke Stuart';'1923'
>
> DA=:A,B,C,D,E,:F
>
>
>
> age=: 13 :'y,.,. <"0-/"1"."1>2 0{"1 y'
>
>
>
> DATA=:age DA
>
>
>
> MAR=:<"0,.1830 0 1867 0 1855 0
>
>
>
> [NEW=:3 2 5$,DATA,.MAR
>
> -----T-----------------------T----T--T----┐
> │1809│Philip St. George Cooke│1895│86│1830│
> +----+-----------------------+----+--+----+
> │1807│Rachel Cooke │1896│89│0 │
> L----+-----------------------+----+--+-----
>
> -----T-----------------------T----T--T----┐
> │1830│John Eaten Cooke │1886│56│1867│
> +----+-----------------------+----+--+----+
> │1840│Mary Frances Cooke │1878│38│0 │
> L----+-----------------------+----+--+-----
>
> -----T-----------------------T----T--T----┐
> │1833│B Jeb Stuart │1864│31│1855│
> +----+-----------------------+----+--+----+
> │1836│B Flora Cooke Stuart │1923│87│0 │
> L----+-----------------------+----+--+-----
>
>
>
>
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see <http://www.jsoftware.com/forums.htm>
> http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see <http://www.jsoftware.com/forums.htm>
http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm