%define;stat1a(z1,z2,z3,z4) %reset_count; %foreach;sorted_list_item; %if;(prev_item.2 != item.2 or prev_item.1 != item.1) %reset_count;%incr_count; %expr(count - 1) %end; %end; %end; %define;stat1b(z1,z2,z3) %reset_count; %foreach;sorted_list_item; %incr_count; %if;(next_item.2 != item.2 or next_item.1 != item.1) %let;l1;%expr(item.2 + z1)%in; %let;l2;%if;(count > l_max_width)%l_max_width;%else;%count;%end;%in; %count; %reset_count; %end; %end; %end; %define;stat1(z1,z2,z3,z4) %if;(not cancel_links and l_max_dates > count) %apply;stat1a(z1,"z2","z3","z4") %else; %apply;stat1b(z1,"z2","z3") %end; %end; %define;stat2() %let;l_height;%expr(40 + (count *2))%in;
%reset_count; %foreach;sorted_list_item; %incr_count; %let;l1;%expr(20 + (count * 2))%in; %let;l2;%expr(20 + item.2 * 8)%in; %let;l3;%if;(l2 > 840)840%else;%l2;%end;%in; %if;(count = 1) %item.1; %level; %end; %if;(next_item.1 = "")%item.1;%end; %item.2; %end;
%end; %define;des_a() %reset_count; %reset_desc_level; %empty_sorted_list; %apply;des_a1(0,l_v) %apply;stat_a1()
%apply;stat_a2() %reset_desc_level; %reset_count; %empty_sorted_list; %apply;des_a2(0,l_v) %apply;stat2()
%end;