Using 'Repeat' value for Options

EXCEPTION TO THE "POSITION" RULE" Normally, !grouped! elements are processed by ‘position’. Whether you select the 1st member of the group or the 50th, the same ‘position’ of other members of the group is returned as the desired value.

   However, when the groupname or a <<*Repeat* . . .>>block is paired with an <<*Options* . . .>> block, the selected option is processed based on an analysis of the actual number provided.

  Zero: If the ‘repeat’ number is 0, the option occupying position 1 of the <<*Options*>> block with the same !groupname! is processed.  

  One: If the ‘repeat’ number is 1, the option in position 2 of the <<*Options*>> block with the same !groupname! is processed.

  Two or more: If the ‘repeat’ number is 2 or higher, the option text in position 3 of the <<*Options*>> block with the same !groupname! is processed.

    Let's illustrate with some sample text. (The logic behind this madness is explained below the block.):

<<*AskRepeat*!Children!How many children?*>>        

<<*AskRepeat*!Bene!How many beneficiaries?*>>                      

(The above would appear at the top of the document. Pathagoras always processes 'Ask' blocks first.)

 

Last Will and Testament of

[Testator Name]

. . .

A. Family: <<*Options*!Children!*I have no children/I have one child whose name is [Name of Child]/I have <<*Repeat(return,two)*!children!*>> children and their names are <<*Repeat(and)*!children!*[Name of Child]>>>>.

. . .

<<*Options*!Children!*/

G. All trust assets shall be distributed to my child named in paragraph A if that child is alive at the time of my death. If my child is not alive at the time of my death, but has surviving descendants, the share that would have gone to such child shall be distributed to such child’s descendants, per stirpes./

G. All trust assets shall be distributed to each child named in paragraph A if that child is alive at the time of my death. If a child of mine is not alive at the time of my death, but has surviving descendants, the share that would have gone to such child shall be distributed to such child’s descendants, per stirpes.>>

<<*Options*!Children!*

H. All assets shall be distributed to <<*Repeat(and)*!Bene![AltBenef Name]  residing at [AltBenef Address]>>, if that beneficiary is alive at the time of my death<<*Options*!Bene!*// ,in equal shares>>. If a named beneficiary should not survive me, such shares shall be distributed to such beneficiary’s descendants, per stirpes./

H. If my child named in paragraph A, and no descendant of such child, shall survive me, all assets shall be distributed to <<*Repeat(and)*!Bene![AltBenef Name]  residing at [AltBenef Address]>>, if that beneficiary is alive at the time of my death<<*Options*!Bene!*// ,in equal shares>>. If a named beneficiary should not survive me, such shares shall be distributed to such beneficiary’s descendants, per stirpes./

H. If no child named in paragraph A, and no descendant of any such child, shall survive me, all assets shall be distributed to <<*Repeat(and)*!Bene![AltBenef Name]  residing at [AltBenef Address]>>, if that beneficiary is alive at the time of my death<<*Options*!Bene!*// ,in equal shares>>. If a named beneficiary should not survive me, such shares shall be distributed to such beneficiary’s descendants, per stirpes.>>

 

There is a real logic behind this operation, and it track the noun/verb pairings used in the English language:

  If there are ‘none’ of something, the plural of the verb is used to describe this ‘nothingness.’

  If there is 'one' of something, the singular is used.

  If there are '2 or more', the plural is used.

  For example:

“There are no children. There is one child. There are 3 children.”

   Further, the actual text (if any text is provided at all) may vary greatly based on the number of children, shareholders, quantity ordered, etc.

  So, when using the same !groupname! with a <<*Repeat*>> block and an <<*Options*>> block, simply set out the appropriate choices for the '0', '1' and '2+', possibilities, separating each choice with slashes.

  informationIf there is no appropriate text to display for one of the choices, you will still need the slash. It then just serves as a holding spot. See just above Paragraph G ('0' children requires no text), and see in Paragraph H near the !bene! group ((there is no ‘equal shares’ possibility for ‘0’ or ‘1’ beneficiary).

"But what if I need separate paragraphs based on all of possibilities reflected in the AskRepeat answer?" Sorry, this tool does not address that situation. We are working on a '<<*Options(choose)* . . .>> tool that will allow you to process a specific result for a specific number. Stay tuned. (And if you have the need for this, write to us. You can help beta test it.)

  informationNOTE: By design, Options blocks will always be processed before Repeat Blocks. This is so even when the Option block is nested within the Repeat block. (In any program, there must always be a processing order or precedence. Here, with the exception described immediately below, the order is 'Options and Optional' blocks first, and then Repeats.)  If you want the document's Repeat blocks to process first, simply present it as an 'AskRepeat' prompt at the top of the document. This is shown in the example.

   If you see your Repeat blocks automatically processing when it bears the same groupname as an Options block, that is because of the above rule. Here's what's happening. When the values for the Options block are presented, and you select one, the value for the !groupname! is immediately set. Then, when the Repeat block is encountered, its value is 'known' to Pathagoras and the Repeat block is repeated the 'appropriate' number of times, based one the Options position selected.

  The 'cumulative' exception: There is an important exception to the above. If the (cumulative) argument, as in <<*Options(cumulative)*!groupname!* . . . .>>, the  <<*Repeat* value will be first applied to the cumulative, at its original value. So if 5 is the answer, the first 5 choices will be accumulated in the normal 'cumulative' fashion. Any 'non-cumulative' <<*Options* . . . >> will be processed as described above.

Note: if the first or second position in an <<*Options* . . .>> block needs to be blank, simple type a '/' (and no text) to indicate the blank nature of the 'answer'. This is illustrated just below the second ellipse (no first choice) and in the 'in equal shares' sentence (no first or second choices) of the above example.