%nn; %apply;a_of_b%with;[*descendants]%and;%self;%end; %sp;[up to] %e.v; %if;(e.v>1)[generation/generations]1%else;[generation/generations]0%end;

%include;css %include;hed %include;perso_utils %message_to_wizard;
%define;tothegen(xxx) %if;(e.v>0)[to the %s generation:::xxx]%nn;%end; %end; %if;not cancel_links; %include;menubar %end;

# %nn; %if;(e.v!=0)%apply;a_of_b%with; %if;(e.only!="on" and e.v!=0)[*descendants]%else; %apply;capitalize%with%apply;gend("v")%end; %end;%and; %self;%end;%else;%self; ([no descendants])%end; %if;(cancel_links and e.v!=0) %apply;togend(e.v)%end;

%if;not cancel_links; %include;buttons %end; %let;central_index;%index;%in; %define;image_MF(xxx) %if;not cancel_links; %if;wizard; %nn; %if;wizard;%nn; %else;%end; %end; %end; %define;link(aaa,xxx,nnn) %if;(e.cgl="on")xxx%else;xxx%end; %end; %define;table_header()
%reset_count; %if;(e.num="on") № %incr_count; %end; [*person/persons]0 %incr_count; %if;(e.birth="on" and e.birth_place="on") [*birth] %incr_count;%incr_count; %elseif;(e.birth="on" and e.birth_place!="on") [*date of birth] %incr_count; %elseif;(e.birth!="on" and e.birth_place="on") [*birth place]0 %incr_count; %end; %if;(e.baptism="on" and e.baptism_place="on") [*baptism] %incr_count;%incr_count; %elseif;(e.baptism="on" and e.baptism_place!="on") [*date of baptism] %incr_count; %elseif;(e.baptism!="on" and e.baptism_place="on") [*baptism place] %incr_count; %end; %if;(e.marr="on" and e.t="H") [*spouse/spouses]1 %incr_count; %end; %if;((e.marr_date="on" and e.marr_place="on") or (e.marr_date="on" and e.child="on") or (e.marr_place="on" and e.child="on")) %nn; [*marriage/marriages]0%nn; %if;(e.marr_date="on" and e.marr_place="on" and e.child="on") %incr_count;%incr_count;%incr_count;%else;%incr_count;%incr_count;%end; %elseif;(e.marr_date="on" and e.marr_place!="on" and e.child!="on") [*date of marriage] %incr_count; %elseif;(e.marr_date!="on" and e.marr_place="on" and e.child!="on") [*marriage place] %incr_count; %elseif;(e.marr_date!="on" and e.marr_place!="on" and e.child="on") %incr_count; %end; %if;(e.death="on" and e.death_place="on") [*death] %incr_count;%incr_count; %elseif;(e.death="on" and e.death_place!="on") [*date of death] %incr_count; %elseif;(e.death!="on" and e.death_place="on") [*death place] %incr_count; %end; %if;(e.burial="on" and e.burial_place="on") [*burial] %incr_count;%incr_count; %elseif;(e.burial="on" and e.burial_place!="on") [*date of burial] %incr_count; %elseif;(e.burial!="on" and e.burial_place="on") [*burial place] %incr_count; %end; %if;(e.age="on") [*age] %incr_count; %end; %if;(e.occu="on") [*occupation/occupations]1 %incr_count; %end;
%if;(e.birth="on" and e.birth_place="on") [*date/dates]0 [*place] %end; %if;(e.baptism="on" and e.baptism_place="on") [*date/dates]0 [*place] %end; %if;((e.marr_date="on" and e.marr_place="on") or (e.marr_date="on" and e.child="on") or (e.marr_place="on" and e.child="on")) %if;(e.marr_date="on") [*date/dates]0%nn; %end; %if;(e.marr_place="on") [*place]%nn; %end; %if;(e.child="on") %nn; %nn; %end; %end; %if;(e.death="on" and e.death_place="on") [*date/dates]0 [*place] %end; %if;(e.burial="on" and e.burial_place="on") [*date/dates]0 [*place] %end;
%end; %define;date_popup(xxx,yyy) %let;symb;%if;("yyy"="birth")°%elseif;("yyy"="death" and xxx.is_dead)†%end;%in; %if;(e.yyy="on" and famx=1) %if;(wizard and not cancel_links) %nn; %if;(xxx.has_yyy_date)%xxx.slash_yyy_date;%else;%symb;%end;%nn; %else; %if;xxx.has_yyy_date;%xxx.slash_yyy_date;%elseif;(not cancel_links)%symb;%end; %end; %end; %end; %define;place_popup(xxx,yyy) %if;(e.yyy_place="on" and famx=1) %nn; %if;xxx.has_yyy_place;%xxx.yyy_place;%end; %end; %end; %( si t=H on active rowspan pour les données de l’individu et du couple si t=I on n’affiche pas les données xxx est la personne concernée (self) zzz est lui même si yyy="desc" ou son conjoint si yyy="spous" %) %define;table_row(xxx, prefx, fff, fam_cnt, ch_cnt, ch_count, yyy, zzz, ddd, nb_ch_desc, implx) %let;famx;%if;(not has_families or e.t="I")1%else;fam_cnt%end;%in; %let;zro;%if;("prefx"="-1")0%else;1%end;%in; %let;labl;%if;(zro=1)%if;("prefx"!="")prefxfff.%end;ch_count%else;1%end;%in; %let;labl0;%if;(zro=1)%if;("prefx"!="")prefxfff.%end;ch_cnt%else;1%end;%in; %let;rowspan;%if;(nb_families>1 and e.t="H" and (e.marr="on" or e.marr_date="on" or e.marr_place="on" or e.child="on")) rowspan="%xxx.nb_families;"%end;%in;
%( numéro d'Aboville %) %if;(e.num="on" and famx=1) %if;("yyy"="desc") %if;(labl!=1 and not cancel_links) %nn; %end; %if;("ch_cnt"="1" and not cancel_links)%end; %labl;
%if;("ch_cnt"="1" and not cancel_links)%end; %elseif;(e.t="I") %if;(not cancel_links) %nn; %end; %if;(has_families and nb_families>1)%apply;letter(family_cnt)%else; %end;%nn; %if;(not cancel_links) %end; %end; %end; %( Descendant et son conjoint en mode I %) %if;(famx=1) %if;("yyy"="desc") %apply;add_in_sorted_list(xxx.index) %apply;add_in_sorted_listc(xxx.index)
%apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%if;(e.fn=1)%xxx.first_name; %xxx.surname;%else;%xxx;%end;%and;%xxx.index;%end; %if;(e.tt=1 and xxx.title!=""), %xxx.title;%end;
%if;(e.im="" and xxx.has_image) %end;
%elseif;(e.t="I") %apply;add_in_sorted_list(xxx.index) %apply;add_in_sorted_listc(xxx.index)
%if;(e.im="" and xxx.has_image) %else;
%end;
%apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%if;(e.fn=1)%xxx.first_name; %xxx.surname;%else;%xxx;%end;%and;%xxx.index;%end; %if;(e.tt=1 and xxx.title!=""), %xxx.title;%end;
%end; %end; %( Date de naissance %) %apply;date_popup%with;xxx%and;birth%end; %( Lieu de naissance %) %apply;place_popup%with;xxx%and;birth%end; %( Date de baptême %) %apply;date_popup%with;xxx%and;baptism%end; %( Lieu de baptême %) %apply;place_popup%with;xxx%and;baptism%end; %( En mode H, conjoints %) %if;(e.marr="on" and e.t="H") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;(family_cnt=fam_cnt) %nn; %apply;add_in_sorted_list(spouse.index) %if;(zzz.nb_families>1)%apply;letter(family_cnt)%end; %apply;image_MF("spouse") %apply;link%with;%spouse.access;%and;%if;(e.fn=1)%spouse.first_name; %spouse.surname;%else;%spouse;%end;%and;%spouse.index;%end; %if;(e.tt=1 and spouse.title!=""), %spouse.title;%end; %end; %end; %end; %end; %( Date de mariage %) %if;(e.marr_date="on") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;((nb_families=1 and "yyy"="desc") or (nb_families>1 and ((xxx.spouse=zzz and (ddd=family.index)) or (xxx=zzz and family_cnt=fam_cnt and e.t="H")))) %if;(wizard and not cancel_links) %nn; %if;(slash_marriage_date != "")%slash_marriage_date;%else; %end; %nn; %else; %slash_marriage_date; %end; %end; %end; %if;(e.t="I" and nb_families>1 and "yyy"="desc") %end; %end; %end; %( Lieu de mariage %) %if;(e.marr_place="on") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;((nb_families=1 and "yyy"="desc") or (nb_families>1 and ((xxx.spouse=zzz and ddd=family.index) or (xxx=zzz and family_cnt=fam_cnt and e.t="H")))) %nn; %if;(marriage_place != "") %marriage_place;%nn; %end; %end; %end; %if;(e.t="I" and nb_families>1 and "yyy"="desc") %end; %end; %end; %reset_count2; %( Calcul nombre total d'enfants %) %if;(zzz.has_families) %foreach;zzz.family; %if;zzz.has_children; %foreach;zzz.child; %incr_count2; %end; %end; %end; %end; %let;nb_ch_tot_desc;%count2;%in; %reset_count2; %( Calcul nombre d'enfants de l'époux %) %if;(e.t="I") %if;(xxx.has_families) %foreach;xxx.family; %if;xxx.has_children; %foreach;xxx.child; %incr_count2; %end; %end; %end; %end; %else; %if;(xxx.has_families and xxx.spouse.has_families) %foreach;xxx.spouse.family; %if;xxx.spouse.has_children; %foreach;xxx.spouse.child; %incr_count2; %end; %end; %end; %end; %end; %let;nb_ch_tot_spous;%count2;%in; %( Nombre d'enfants %) %if;(e.child="on") %if;(xxx.nb_families=0) %else; %foreach;xxx.family; %if;((nb_families=1 and "yyy"="desc") or (nb_families>1 and ((xxx.spouse=zzz and (ddd=family.index)) or (xxx=zzz and family_cnt=fam_cnt and e.t="H")))) %nn; %if;(nb_children>0 and not cancel_links)%end; %if;("yyy"="desc" and e.t="I") %nb_ch_tot_desc;%if;(nb_ch_tot_desc!=nb_ch_tot_spous)/%nb_ch_tot_spous;%(!! nb_ch_tot_spous is wrong: gives father total of children?! %)%end; %else; nb_ch_desc%if;(nb_ch_desc!=nb_ch_tot_spous)/%nb_ch_tot_spous;%end; %end; %if;(nb_children>0 and not cancel_links)%end; %end; %end; %if;(e.t="I" and nb_families>1 and "yyy"="desc") %nb_ch_tot_desc; %end; %end; %end; %( Date du décès %) %apply;date_popup%with;xxx%and;death%end; %( Lieu de naissance %) %apply;place_popup%with;xxx%and;death%end; %( Date de la sépulture %) %apply;date_popup%with;xxx%and;burial%end; %( Lieu de la sépulture %) %apply;place_popup%with;xxx%and;burial%end; %( Âge %) %if;(e.age="on" and famx=1) %nn; %if;xxx.computable_death_age;%xxx.death_age;%end;%nn; %if;xxx.computable_age;%xxx.age;%end;%nn; %end; %( Profession %) %if;(e.occu="on" and famx=1) %nn; %if;(xxx.has_occupation) %xxx.occupation%nn; %end; %end; %end; %define;one_child(xxx, prefx, fff, ch_cnt) %incr_count; %( Les enfants d'une personne sont numérotés de 1 à n indépendamment du nombre de mariages %) %let;prfx;%if;("prefx"="-1")%else;prefx%end;%in; %if;(e.t="A") %( d’Aboville %)
%prfx; %apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%xxx.first_name; %xxx.surname;%nn;%and;%xxx.index;%end;%nn; %xxx.title;%nn; %if;(has_families) %foreach;family; %if;(wizard and not cancel_links) %if;(slash_marriage_date != "")%slash_marriage_date;%else;%end;%nn; %else; %slash_marriage_date;%nn; %end; %apply;image_MF("xxx.spouse") %apply;link%with;%xxx.spouse.access;%and;%xxx.spouse.first_name; %xxx.spouse.surname;%and;%xxx.index;%end;%nn; %xxx.spouse.title; %end; %end; %elseif;xxx.has_families; %if;(e.t="H") %foreach;family; %let;ifam;%family.index;%in; %reset_count1; %foreach;sorted_listb_item; %if;(item.1=ifam) %incr_count1; %end; %end; %reset_count2; %foreach;sorted_listc_item; %if;(item.1=index) %incr_count2; %end; %end; %if;(count1=0 or count2=0 or e.implx="") %apply;table_row("xxx", prfx, fff, family_cnt, "ch_cnt", count, "desc", "xxx", family.index, nb_children, count1+count2) %end; %apply;add_in_sorted_listb(ifam) %end; %elseif;(e.t="I") %reset_count1; %foreach;sorted_listc_item; %if;(item.1=index) %incr_count1; %end; %end; %if;(count1=0 or e.implx="") %apply;table_row("xxx", prfx, fff, family_cnt, "ch_cnt", count, "desc", "xxx", 0, nb_children, count1) %end; %apply;add_in_sorted_listc(index) %if;(e.marr="on" or e.marr_date="on" or e.marr_place="on" or e.child="on") %foreach;family; %let;ifam;%family.index;%in; %reset_count1; %foreach;sorted_listb_item; %if;(item.1=ifam) %incr_count1; %end; %end; %reset_count2; %foreach;sorted_listc_item; %if;(item.1=spouse.index) %incr_count2; %end; %end; %if;(count1=0 or count2=0 or e.implx="") %apply;table_row("xxx.spouse", prfx, fff, family_cnt, "ch_cnt", count, "spous", "xxx", family.index, nb_children, count1+count2) %end; %apply;add_in_sorted_listb(ifam) %end; %end; %end; %else; %reset_count1; %foreach;sorted_listc_item; %if;(item.1=xxx.index) %incr_count1; %end; %end; %if;(count1=0 or e.implx="") %apply;table_row("xxx", prfx, fff, "", "ch_cnt", count, "desc", "xxx", 0, 0, count1) %end; %apply;add_in_sorted_listc(xxx.index) %end; %end; %define;families_of_one_p(xxx, prefx) %reset_count; %foreach;family; %let;fam;%if;(e.num="on" and nb_families>1)%apply;letter(family_cnt)%end;%in; %(if;(nb_children>0)
one family: #labl
%end;%) %foreach;xxx.child; %apply;one_child("xxx", "prefx", "fam", child_cnt) %end; %end; %end; %( d’Aboville %) %define;list_row(xxx, prefx, fam_cnt, ch_cnt) %let;fam;%if;(fam_cnt>0)%apply;letter(fam_cnt)%end;%in; %if;("prefx"!="")
prefx.%end; %sp;%apply;image_MF("xxx") %apply;link%with;%xxx.access;%and;%xxx.first_name; %xxx.surname;%and;%xxx.index;%end;%nn; %if;(xxx.title!=""), %xxx.title;%end; %if;(has_families) %foreach;family; %sp;&%if;(nb_families>1)%apply;letter(family_cnt)%end; %if;(wizard and not cancel_links) %if;(marriage_date.year != "")%marriage_date.year;%else;%end;%nn; %else; %marriage_date.year;%nn; %end; %sp;%apply;image_MF("xxx.spouse") %apply;link%with;%xxx.spouse.access; %and;%xxx.spouse.first_name; %xxx.spouse.surname;%and;%xxx.spouse.index; %end; %if;(xxx.spouse.title!=""), %xxx.spouse.title;%end; %( (%xxx.nb_children; %if;(1=0 or 1=0 and xxx.spouse.has_families and xxx.spouse.nb_children0)%apply;letter(fam_cnt)%end;%in; %let;nnpref;%npref;%fam;%in; %if;(lv1)%family_cnt;%else;0%end;%in; %if;(has_children) %foreach;child; %let;num;%if;(npref!="").%end;%child_cnt;%in; %let;nnnpref;%nnpref;%num;%in; %apply;one_person("child", lv+1, max_l, nnnpref, nfam, child_cnt) %end; %end; %end; %end; %else; %apply;list_row("xxx", nnpref, fam_cnt, ch_cnt) %end; %end; %( Parcours de l'arbre, horizontal, niveau par niveau descendant %) %( À chaque niveau, prefx et faml (lettre) définissent le préfixe d'Aboville %) %define;one_level(xxx, lv, max_l, prefx, faml, ch_cnt) %let;npref;%if;("prefx"!="")prefxfaml.%end;ch_cnt%nn;%in; %if;(lv1)%apply;letter(family_cnt)%end;%in; %foreach;child; %apply;one_level("child", lv+1, max_l, npref, fam, child_cnt) %end; %end; %end; %else; %apply;families_of_one_p("self", npref) %end; %end; %define;desc_count(vvv,ooo,nnn,ttt,ccc)%( lev,only=1,name=1,total=1,count2 %) %reset_count1;%reset_count2; %foreach;descendant_level; %if;(level=vvv) %if;(ooo=0) %if;(number_of_descendants=1)%incr_count1;%if;(ttt!=1)1%end; %else;%number_of_descendants;%nn; %end; %if;(number_of_descendants=ccc)incr_count2;%end; %else; %if;(number_of_descendants_at_level=1)%incr_count1;%if;(ttt!=1)1%end; %else;%number_of_descendants_at_level;%nn; %end; %if;(number_of_descendants_at_level=ccc)%incr_count2;%end; %end; %end; %end; %if;(nnn=1)%(show names%) %if;(count1=1) %if;(ttt=1)[a descendant]0%(to remove if [descendant/descendants] is added to lexicon%) %else; %if;(vvv<10) [cousins.0.vvv]0%else; [person/persons]0%end; %end; %else; %if;(ttt=1) [descendants]%nn; %else; %if;(vvv<10) [cousins.0.vvv]1%else; [person/persons]1%end; %end; %end; %if;(ttt=1 and count2!=1) %if;(ooo=1) (ccc [person/persons]1 [with] [spouse/spouses]1)%nn; %else; %if;(e.marr="on" or e.t="I") (ccc [person/persons]1 [with root, spouses and unknowns])%end; %end; %end; %end; %end; %define;cousins_l(lll) %cousins_cnt.0.lll; %end; %define;cousins_p(lll) %cous_paths_cnt.0.lll; %end; %define;cousins_r(lll) %cous_paths_cnt_raw.0.lll; %end; %define;cousins_i(lll) %cous_implx_cnt.0.lll; %end; %define;desc_cousin_count_l(xxx) %foreach;descendant_level; %if;(level=xxx)%apply;cousins_l(xxx)%end; %end; %end; %( Main %)

%if;(e.t="A") %let;nb_col;1%in; %apply;one_person("self", 0, e.v, "", 0, 0) %else; %reset_count; %apply;table_header() %let;nb_col;%expr(count)%in; %let;max;%e.v;%in; %reset_count; %empty_sorted_list; %( persons %) %empty_sorted_listb; %( families %) %empty_sorted_listc; %( descendants %) %if;(e.only!="on") %apply;one_child("self", "-1", "", 1) %for;lev;0;max; %let;nbd1;%apply;cousins_l(lev+1)%in; %let;nbd2;%apply;cousins_p(lev+1)%in; %let;nbd3;%apply;cousins_r(lev+1)%in; %if;(e.gen=1 and lev [*generation/generations]0 %expr(lev+1)[:] %if;(nbd1=nbd2) %apply;desc_count(lev+1,1,1,0,0) %else; %apply;desc_count(lev+1,1,1,0,0), (%apply;cousins_l(lev+1) [descendants at the generation]) %end; %let;implx;%apply;cousins_i(lev+1)%in; %if;(implx>0) et %implx; descendants déjà vu précédemment%end; %end; %apply;one_level("self", 0, lev, "", "", 1) %end; %else; %if;(e.v=0) %apply;one_child("self", "-1", "", 1) %else; %apply;one_level("self", 0, e.v-1, "", "", 1) %end; %end; %end;

%reset_count; %foreach;sorted_list_item; %incr_count; %end;
[*total][:] %if;(e.v<=static_max_desc_level) %if;(e.only="on") %apply;desc_count(e.v,1,1,1,count) %else; %apply;desc_count(max_desc_level,0,1,1,count) %end; %else;0 [person/persons]0%end;.
%base_trailer; %include;copyr %include;js