%include;ancsosa_deslist %define;descendants_by_list(xx,yy,curlev,maxlev) %if;(curlev = 0)
%nl;%end; %apply;link1("xx","yy") %apply;somebody_info1("xx") %apply;somebody_info2("xx") %foreach;xx.family; %if;(evar.spouse="on")
%if;(family_cnt != 1 and curlev = 0)
%nl;%end; %apply;marriage_info() %apply;link1("spouse","spouse") %apply;somebody_info1("spouse") %apply;somebody_spouse_parent() %apply;somebody_info2("spouse")
%end; %if;(curlev < maxlev) %if;(curlev = 0 or evar.t = "M" and xx.is_male or evar.t = "F" and xx.is_female or evar.t = "L" and evar.t1 = "1" and xx.has_sosa or evar.t = "L" and evar.t1 = "") %if;(family.desc_level < curlev) ⇒ [see further] %apply;lazy_print%with;%nl;%end; %elseif;(family.desc_level > curlev) ⇒ [see above] %apply;lazy_print%with;%nl;%end; %elseif;has_children; %family.set_infinite_desc_level; %if;(curlev = 0)
%nl;%end;
    %foreach;child; %if;(evar.t1 = "" or evar.t1 = "1" and evar.siblings = "on" or evar.siblings != "on" and has_sosa)
  1. %apply;descendants_by_list("child",lchild,curlev+1,maxlev)
  2. %end; %end;
%apply;lazy_print%with;%end; %else; %if;(curlev = 0)%nl;
%nl; %else;%apply;lazy_print%with;%nl;%end; %end; %end; %end; %else;%nl; %apply;lazy_print%with;%nl;%end; %end; %end; %end; %define;by_list() %reset_count;

%if;(evar.t = "F") [*male line/female line]1 %elseif;(evar.t = "M") [*male line/female line]0 %end; %if;(evar.t1 = "1" and has_sosa) [*branch/branches]0 : Sosa %end; %if;(evar.i1 = "" and evar.p1 = "") %apply;togen() %else; [*up to] %pvar.1; %pvar.1.dates; %end;

%apply;descendants_by_list("self","self",0,l_v)%nl; %if;(evar.t1 != "1")

%foreach;descendant_level; %if;(level = l_v) [*total] : %number_of_descendants; [[person/persons]1@(c)] %end; %end;

%end; %end; %( main %) %apply;by_list()