'Repeat' Function

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

   A 'repeat' function is the ability of a program to bring in a second (third, fourth, etc.) copy of a particular clause into a document, based on the value of a precedent 'counter' variable.

   Beginning with Pathagoras 2009, a repeat function exists. Indeed, because of its plain text base, Pathagoras can actually provide this 'repeat' feature in a wide variety of ways.

   In its simplest iteration, you need the keyword <<*Repeat*>> and a groupname. The groupname is used to link to other locations in the document when the clause(s) that will be repeated the specified number of times is/are identified.

   At or near the top of the document, you would want to insert the <<*Repeat*!groupname!>> keyword. The  initial appearance of this sequence with nothing more tells Pathagoras go ask how many of the groupname (children, participants, shareholders, etc) there are. Further down in the document, you would place <<*Repeat*!groupname!*(clausename)>>. The clausename is the specific clause that you want repeated at that location. All !groupnames! are tied together, so you can have an unlimited number of <<*Repeat*!groupname!*(clausename)>> entries in the document (or clauseset).

   Here is an example:

  <<*Repeat*!shareholders!*>>

   The following individuals own stock in the corporation:

   <<*Repeat*!shareholders!*[ShareholderName] [SharesOwned]>>

  The shareholders waive notification of the upcoming annual meeting as evidenced by their signatures below:

   <<*Repeat*!shareholders!*_________________

                            [ShareholderName]>>

When encountered during a document assembly session, the very first line will cause Pathagoras to ask for the number of shareholders. It will use the answer further down the document to duplicate the text between the << and >> markers the designated number of times, with all variables inside of those terms properly incremented.

Let's say that the example shown above were processed. Here is what the result would look like if the answer to the first line were 3.:

   The following individuals own stock in the corporation:

   [ShareholderName@1], [SharesOwned@1]

   [ShareholderName@2], [SharesOwned@2]

   [ShareholderName@3], [SharesOwned@3]

  The shareholders waive notification of the upcoming annual meeting as evidenced by their signatures below:

                 ____________________________

               [SharholderName@1]

                 ____________________________

               [SharholderName@2]

                 ____________________________

               [SharholderName@3]

  The above sample will capture the number of repeats, but will not 'return' that value (i.e, '1' , '2' etc.)to the editing screen. If you want to return a value at the same time you make your selection, you need to set up the initial line like this.

       <<*Repeat*!shareholders!Return*1>>  or

       <<*Repeat*!shareholders!Return*one>>

       The "1" (or any other 1 or 2 digit number) simply tells Pathagoras to return the Arabic numeral; the "one" (or any other number) tells Pathagoras to return a "spelled out" number. The number provided becomes the 'default' value when the 'how many' question is asked.

       Example:

   The following <<*Repeat*!shareholders!Return*five>> individuals own stock in the corporation:

   <<*Repeat*!shareholders!*[ShareholderName] [SharesOwned]>>

  The shareholders waive notification of the upcoming annual meeting as evidenced by their signatures below:

   <<*Repeat*!shareholders!*_________________

                            [Shareholder Name]>>

=====================

tipIf you don't like the default placement of the '@1', '@2' etc. at the end of the variable, you can 'tell' Pathagoras where to put the incrementing number by pre-placing the '@' sign.  So, if a variable were written [Shareholder@ Address], it would increment [Shareholder1@ Address], [Shareholder2@ Address], etc.

lightbulbsmallYou can reference an external clause (document or glossary term) instead of 'hard coding in the text. The clause must either be one named with the prefix/suffix naming style (and with the prefix properly registered), be 'fully qualified (full path name) or located in one of the search locations listed in the Order of Search page.

=====================

informationThere are two other 'Repeats' functions which operate in a fashion similar to the 'direct' method described below.

1. The Clause Selection Screen provides a 'Repeats' box that displays when a single non-set element has been selected in the right panel. When completed, Pathagoras will insert the selected clause the designated number of times.
2.DropDown Lists also provide 'Repeat'-ability. When you want to repeat a clause, first scroll down to the bottom of the List that contains the clause and click the "Repeat next selection X times" element. Then select the clause you want repeated. Pathagoras will ask 'How many times?" and perform accordingly.

=====================

But wait! There is still more!

tipAfter you have run any of the above routines and brought in, let's say, 5 'repeats' of a particular clause, and you find that you need a sixth, simply type the word "repeat" at the location where you need the next clause, followed by the key press <Alt-G>.

=====================

   There are other methods available in Pathagoras which mimic the 'Repeats.' They offer more controlled results in terms of 'variable naming.' However, this may be more information that anyone needs. Read on only if the above 'Repeats' functions do not serve your needs.

The easiest and most straightforward solution is simply to prepare substantially identical clauses to the one you want repeated. Each clause differs from the others in that they reflect 2, 3 or 4, etc.of the element sought to be repeated. This solution requires no coding on your part. It just requires that you to save additional clauses to reflect the desired ends.

For example, in a Will, you might have the following alternative clauses reflecting from zero to four children:

wil120a

There were no children born of this marriage.

wil120b

There was one child born of our marriage, namely [Child1Name] born [Child1DOB].

wil120c

There were two children born of our marriage, namely [Child1Name] born [Child1DOB] and [Child2Name] born [Child2DOB].

wil120d

There were three children born of our marriage, namely [Child1Name] born [Child1DOB], [Child2Name] born [Child2DOB], and [Child3Name] born [Child3DOB].

wil120e

There were four children born of our marriage, namely [Child1Name] born [Child1DOB], [Child2Name] born [Child2DOB], [Child3Name] born [Child3DOB] and [Child4Name] born [Child4DOB].

   When you are assembling a clause, simply select the appropriate 'family size' clause from the list of clause options. This technique is straightforward and easy to implement.

The same result can be achieved by using a combination of two powerful Pathagoras functions, namely MultiChoice *Lists* and {Simplified Options}.  A MultiChoice *Lists* is simply a string of alternative text, separated by slashs ("/") and stored in the MultiChoice *List* table. (Creating and editing these *Lists* is very simple.)

Instead of saving the permutations as separate documents, you can save them as part of the MultiChoice *List* collection.

   Step 1:Create a MultiChoice *List* called, for example, "children." Include the following variables as its value:

There were no children born of this marriage/There was one child born of this marriage, namely [Child1Name], born [Child1DOB]/There were two children born of this marriage, namely [Child1Name], born [Child1DOB] and [Child2Name], born [Child2DOB]/There were three children born of this marriage, namely [[Child1Name], born [Child1DOB], [Child2Name], born [Child2DOB], and [Child3Name], born [Child3DOB]/There were four children born of this marriage, namely [[Child1Name] born [Child1DOB], [Child2Name] born [Child2DOB], [Child3Name], born [Child3DOB] and [Child4Name], born [Child4DOB]/There were five children born of this marriage, namely [[Child1Name], born [Child1DOB], [Child2Name] born [Child2DOB], [Child3Name], born [Child3DOB], [Child4Name], born [Child4DOB] and [Child5Name], born [Child5DOB]

   Step 2: Insert the following text in the source document:

There were [number of children] children born of our marriage, namely {*children*}.

   When the document is assembled, Pathagoras will pause at the Options text {*children*} and present the options contained in the *childrens* list. Select the appropriate one.

    This technique is further illustrated near the bottom of the MultiChoice *Lists* page on this site.

    information The same result can also be achieved by using Pathagoras regular <<*Options*>> formula with questions assigned, and setting up a appropriate MultiChoice *List* for 'children' as described above. The MultiChoice *List* for children is identical to that which is described immediately above, but the text introducing the <<*Options*>> block which introduces the questions is a little more complex. Here is an example. Try this:

<<*Options*One Child/Two Children/Three Children/Four Children/Five Children**children*>>

    information A similar result can also be achieved by using Clause Sets. Clause Sets are virtual documents that contain pointers to clauses, the entire collection of which represents a complete document. You can design individual clauses and then a Clause Set to represent a complete document for (following the above example) 'no children', 'one child', and 'multiple children'.

    information Here is one more example to illustrate 'repeats.' It is similar to the first example above.  Each clause is created following the same format, with the name of each document reflecting the number of repeats desired. So, let's say you want to prepare for cases where you have multiple buyers and sellers to a real estate deal.

Save documents named, e.g., 'Buyers1.doc' with the content:

[Buyer Name], [Buyer Address], party of the second part.

a second document called 'Buyers2.doc' with content:

[Buyer1 Name], [Buyer1 Address] and [Buyer2 Name], [Buyer2 Address], parties of the second part.

. . .

a fifth document called 'Buyers5.doc' with content:

[Buyer1 Name], [Buyer1 Address], [Buyer2 Name], [Buyer2 Address], [Buyer3 Name], [Buyer3 Address], [Buyer4 Name], [Buyer4 Address] and ,[Buyer5 Name], [Buyer5 Address], parties of the second part.

etc.  (A similar set of terms could be created for multiple sellers.)

The source clause might read:

       This Contract made by and between {Sellers1/Sellers2/Sellers3/Sellers4/Sellers5} and {Buyers1/Buyers2/Buyers3/Buyers4/Buyers5}

   When assembling the new document, select the appropriate item for the document when the options text block (the text between the {curly braces} is processed.

Page url: http://www.pathagoras.com/help/index.html?repeat_function.htm