Loading ...
Sorry, an error occurred while loading the content.

[Clip] Getting there...slowly

Expand Messages
  • stephen yearl
    Ray: The clip so far: It s really ugly, and the terminations of the and has yet to be sorted out (the termination depends on the level of
    Message 1 of 1 , Apr 19 5:23 AM
    • 0 Attachment
      Ray:

      The clip so far:

      It's really ugly, and the terminations of the </items> and </lists> has
      yet to be sorted out (the termination depends on the level of nesting,
      and the respective numbers of series and subseries entered by the user),
      but the looping logic is there, I think.

      regards,
      Stephen


      H="Coll.Over. with List"
      ;establishes input and common text variables
      ^!Set
      %CommonText%=<organization><head>Organization</head>^%nl%<p>Materials
      are organized into
      ^!Set %p_NoSer%=^?{(M="0;0;#")# of Series=^%p_NoSer%};
      %p_NoSubSer%=^?{(M="0;0;#")# of Sub-Series, if any=^%p_NoSubSer%}
      ^!Set %Basis%=^?{Basis for series organization==_custodial
      history|previous arrangement|standard practice}

      ;if series only
      ^!If "^%p_NoSubSer%" > 0 Sub
      ^%CommonText% ^%p_NoSer% series, based on ^%Basis%.</p>^%nl%
      <List>^%nl%
      ^!Set %NoSer%=^%p_NoSer%
      :LOOP
      ^!If "^%NoSer%" < 1 List
      ^!Dec %NoSer% 1
      ^!Set %p_NameSer%=^?{Name of Series=^%p_NameSer%}
      <item>^%p_NameSer%</item>^%nl%
      ^!GoTo LOOP
      :LIST
      </list>^%nl%
      ^!Goto End

      ;if also sub-series
      :SUB
      ^%CommonText% ^%p_NoSer% series and ^%p_NoSubSer% sub-series, based on
      ^%Basis%.</p>

      ^!Set %NoSer%=^%p_NoSer%
      :SUBA
      ^!If "^%NoSer%" < 1 End
      ^!Dec %NoSer% 1
      ^!Set %p_NameSer%=^?{Name of Series=^%p_NameSer%};%p_HowSubSer%=^?{How
      many suberies in this series?=^%p_HowSubSer%}
      ^!If "^%p_HowSubSer%" = 1 Pre
      ;this is the bit that gets me confused
      ^!If "^%p_HowSubSer%" > 1 Ante
      <item>^%p_NameSer%</item>
      ^!GoTo SUBA

      :PRE
      ^!Set %NoSubSer%=^%p_HowSubSer%
      :ONE
      ^!If "^%NoSubSer%" < 1 Suba
      ^!Dec %NoSubSer% 1
      ^!Set %p_NameSubSer%=^?{Name of Sub-Series=^%p_NameSubSer%}
      <item>^%p_NameSer%^%nl%<list><item>^%p_NameSubSer%</item></list>^%nl%</item>
      ^!GoTO One

      :ANTE
      ^!Set %NoSubSer%=^%p_HowSubSer%
      <item>^%p_NameSer%^%nl%<list>
      :MORE
      ^!If "^%NoSubSer%" < 1 Suba
      ^!Dec %NoSubSer% 1
      ^!Set %p_NameSubSer%=^?{Name of Sub-Series=^%p_NameSubSer%}
      <item>^%p_NameSubSer%</item>
      ^!GoTO More

      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/list/ntb-clips
      Free Web-based e-mail groups by eGroups.com
    Your message has been successfully submitted and would be delivered to recipients shortly.