Initiating Processing:
•The processing sequence is initiated automatically when a document (or set of documents) is called via the Document Assembly 'Clause Selection Screen' or when a document is called from a DropDown List.
•Processing also begins when the user presses <Alt-P> to 'force' processing from the keyboard.
•The real action begins when Pathagoras detects a balanced '<<' and '>>' set. (We call these 'double angle brackets' or DAB sets).
•Processing ends when no more balanced DAB sets can be found.
Order of processing:.
Processing takes place from top to bottom of the document, from outside to inside. The exceptions are these:
1.<<*AskTable*>> (interview) items are processed first, in strict top to bottom order..
2.If any are remaining after the processing of <<*AskTable*>> elements, <<*Options*>> and <<*Optional*>> blocks are processed next (or simply first, if no AskTable is present).
3.<<*Repeat* commands are processed after <<*Options*>> and <<*Optional*>> blocks. That is to allow a possible nested <<*Optional*<<*Repeat*. . .>>>> blocks to be processed in case the <<*Repeat* is not to be kept. An exception to this exception is this: if the <<*Repeat*!group!* . . .>> is called via and <<*AskRepeat*!group! . . .>> call, it will be processed in the order of appearance in the AskTable.
4.Items in a !groupname! family are processed as one. All elements of the !group! once the !group! value is set., regardless of intervening '<<. . . >>' blocks. You should take advantage of this 'rule,' and set the order of processing in any fashion you desire, by using <<*AskOptions*, <<AskOptional* and <<AskRepeat* blocks (all of which require the setting of a !group! value) at the top of the document.
5.A <<document call>> (i.e., just the name of a document inside of DABs) is processed last. If the document called in by a <<document call>> itself has DAB sets, they are processed in a recursive fashion, and in the order described above.
6.A '<< . . . >>' call placed within a Content Control is invisible to the Alt-P (or other automatic processing call) unless the cursor is within the Content Control when Alt-P is triggered. When that happens, the content control is erased, and processing begins. Typically the only item that is processed is the command in the Content Control (since presumably the command was in the Content Control to delay its processing until everything else was done), but if there are other unprocessed '<< . . .>>' calls not in Content Controls, they will be processed in the above describe order.
Hints/Tips
•Don't forget that a !groupname! value, once set, is not requested again. So if you have an Option (or AskOption) element that ask you to choose A, B or C and you choose B, the !groupname! value is set at 2. If you use that same groupname for a Repeat, you will get 2 repeats. (Pathagoras will not ask for the value again . . .it thinks it doesn't need to.) So either set the value for the Repeat first and take advantage of Repeat with Options processing (this is a really cool tool) or set separate !groupnames! for the Options and the Repeat blocks.
•An alternative way to delay processing of Options text is to place it into a document that you will later call as a document call. But instead of surrounding the call with DABs, simply types its name and following it with "(altg)". Eg., "Simple will(altg)". ('Simple will' being a document containing Pathagoras elements.) This is a very low tech way of accomplishing your goal. The (altg) can be painted and searched so that you or other users won't miss the call.