Selecting Optional text using the actual value of an Options selection.
When you select a value from an <<*Options*!Groupname!*>> group, Pathagoras typically selects the appropriate value in a subsequent options block bearing the same !groupname! by using its position in the list. So, if you select the third choice of the <<*Options*!groupname!*. . .>> block, the same '3rd place' selection would be made for subsequent options blocks further down in the document.
But Pathagoras records both position of your choice and the actual ('hard') value of the choice. By doing so, Options blocks can feed an Optional text block using this 'hard' (as opposed to 'positional') value. If the 'hard' value being test for in the Optional text equation was selected in the initial Options choice, the Optional text will remain. Otherwise (as is typical of all Optional text), it will be deleted.
The formula to test for the 'hard' value in the subsequent Optional text block is simply :
<<*Optional*!Groupname = Value! . . . .>>
Note: a {simple optional} formula will work just as well. The above could be constructed:
{!Groupname = Value! . . . .}
If the 'hard' value of groupname is the same as the value selected from the original list, then the Optional text will be retained. Otherwise it will be deleted.
Multiple values can be provided, with each element separate from the others with a slash.
Further explanation and examples:
Positional ('classic') Method:
Using a classic Options block structure, you allow the user to choose which of 3 states the document is being prepared in.
<<*Options*!state!*Colorado/Virginia/New York>>
<<*Options*!state!*I love the mountains of Colorado./Virginia is for lovers./There is no place like New York!>>
When you select from the choices Colorado, Virginia or New York called for in the first Options line, Pathagoras records the position of the answer and returns the same positional element in the *States* alias list called in the second Options line.
But sometimes the values in the initial options line (where the controlling selection is made) are numerous, but the need for responsive text applies to only a small set (perhaps just one item) of selection. E.g., if the selection is 'New York', insert the text, otherwise, leave blank. If only a positional evaluation were made, the second options list would have to contain 50 elements, all but the New York position (alphabetically #31 of the 50 United States) being blank.
To avoid that circumstance, you can create an <<*Optional*!groupname! . . . >> text block in which you evaluate the 'hard' value of the groupname as previously assigned. If the evaluation is true, the Optional text is preserved. If not true, it is deleted.
'Hard Value' Choice:
<<*Options*!state!*Alabama/Alaska/California/Colorado/Virginia/New York>> (Same as above, but with more choices.)
(in body):
<<*Optional*!state = Colorado!*Colorado has great skiing.>>
<<*Optional*!state = Virginia!*History buffs will find Virginia an incredible place to visit.>>
So if 'Colorado' is initially selected when the choices are presented from the 'top' line, the 'Colorado' language in the body would stay. The 'Virginia' language would be deleted.
If, on the other hand, 'Virginia' is initially selected, the 'Colorado' text would be deleted.
If any other state is selected, both optional blocks would be deleted.
Note: As you are setting up the text, remember that the evaluation that lead to action of an "<<*Optional* text" block is essentially 'true' or 'false'. If 'true', the optional block is preserved. If 'false', it is deleted.) By added the '=' to the !groupname!, you initiate that evaluation process on values that were initially not 'true/false'. ('Colorado' is neither 'true' nor 'false', but 'State=Colorado' can be.)
(You can cut and paste above examples into a document and see the action via <Alt-P>.)
You can also use '{simple options} to set up the document;
{!state!Alabama/Alaska/California/Colorado/Virginia/New York>>
(in body):
{!state = Colorado!*Colorado has great skiing.}
{!state = Virginia!*History buffs find Virginia an incredible place to visit.} (in body)
You are not limited to a manually typed list. You can use MultiChoice Lists to supply the choices.
<<*Options*!state!**States*>> (at or near top; the double '**' is correct.)
(States is a MultiChoice variable that ships with Pathagoras. Therefore, you can use these examples with no additional setup.)
<<Optional*!state = Colorado!*Colorado has great skiing.>>
<<*Optional*!state = Virginia!*History buffs find Virginia an incredible place to visit.>>
Remember: This feature is best used where it is impractical to code all 'subsequent' values in a long list. This should be particularly useful when a lot of choices must be presented in the initial request for value (perhaps, as in the above examples, all 50 United States are displayed in the selection screens), but only a few of those choices require extra text. (With the positional method, you would have to have a slash as a simple holding place for each 'no-extra text' situation.)
One more example. Let's say that California, but no other state, has a statutory requirement that certain text must be included in certain documents.
{!State!*States*} (at or near top)
{!State = California!This is a special clause required for California transactions only.} (in body)