Explict and Implicit !GroupName! settings

   Pathagoras offers much more power and flexibility to choices made in response to <<*AskOptions* . . . >> blocks than at first may meet the eye.

  When an <<*AskOptions* equation is processed, the selections (actually, their positions) are 'explicitly' assigned to the !groupname' attached to the equation. Consider the following example:

 <<*AskOptions*!Fruit!Apples/Bananas/Cherries/Dates*>>

   If the user selects Apples and Cherries, the groupname !Fruit! is explicitly set to "1,3".

   Additionally the individual elements of the <<*AskOptions* . . .>> are implicitly assigned a True/False value that can be used for calculations and evaluations anywhere in the document as if it were assigned via individual <<*AskOptional* . . . >> requests for each element.

   So, completing the example, !Fruit1 is set to "1,3" and !Apples! is set to "True", !Bananas! to "False", !Cherries! to "True" and !Dates! = "False". (The value of the implicitely created !groupnames! is the exact language of the choice, so long as the text of the choice was 39 or fewer characters.)

   An example works best. You can copy and paste the entire block of text to an editing screen. To process it, press <Alt-P>.

--Copy Below--


The below (left column) is a standard ‘AskOptions’ prompt.  

Ask Block Text

Before processing

After processing

<<*AskOptions*!Fruit!Apples/Bananas/Cherries*>>

AskOptions block displays the !groupname! and menu choices you want to provide to end user.

This line will disappear once the Ask block has been answered. If Apples and Cherries are checked, the value of the !groupname! ‘Fruit’ is set to ‘1,3’

 

Document body standard behavior:

Body Text

Before processing

After processing

<<*Options*!Fruit!I eat an apple a day./I like bananas in my cereal./I prefer a cherry on my sundaes.>>

Options block created in normal fashion, with ‘Optional’ designator and !groupname! followed by the body text.

Since Fruit = "1,3" (per above example), the second option is excised, leaving the first and third options in the document, leaving
I eat an apple a day. I prefer a cherry on my sundaes.

 

Pathagoras automatically new !groups! for each element of AskOptions list
assigning to each a 'true' or 'false' value (depending upon whether it was chosen)
These implicitly created !groups! may be used in the document body
in the same way that other <<*Optional* . . . >> blocks are created and used.
(Recall that 'Optional block' !groups! contains only a 'true' or 'false' values.

Body Text

Before processing

After processing

<<*Optional*!Apples!*An apple a day keeps the doctor away.>>

Optional block created in normal fashion, with ‘Optional’ designator and !groupname! followed by the body text.

‘Apples’ was checked in the AskOptions listing per our example above. A new !groupname! called ‘!Apples!’ was established, and its value set to ‘True’. The text will remain.

<<*Optional*!Bananas!*My doctors tells me that bananas are the perfect fruit.>>

“”

Bananas was unchecked in the AskOptions listing. A new !groupname! called ‘!Bananas!’ was established. Its value is ‘False’. The text is deleted.

<<*Optional*!Cherries!*Please top my [sundae/milkshake] with a cherry.>>

“”

‘Cherries’ was checked in the AskOptions listing per our example above. A new !groupname! called ‘!Cherries!’ was established. Its value is set to ‘True’ and so the text will remain.

 

Optional can also accommodate /NEGOPT outcomes.

 

To enable, just add a '/NEGOPT' (for negative optional) and some 'alternative' text.

If the !Group! value of the optional block is True, the text before the /NEGOPT is kept;

if false, the text after the /NEGOPT is kept.

Body Text

Before processing

After processing

<<*Optional*!Apples!*An apple a day keeps the doctor away./NEGOPTThose wormy apples didn’t keep my doctor away.>>

Optional block created in normal fashion. However, a ‘false’ value was attached, with ' /NEGOPT' separating the ‘True’ value from the ‘False’. (Coloring, italics and underlining for illustration only.)

‘Apples’ was checked in the AskOptions listing per our example above. A new !groupname! called ‘!Apples!’ was established, and its value was set to ‘True’, so the ‘true’ side of the Optional block will remain.

<<*Optional*!Bananas!*My doctors tells me that bananas are the perfect fruit./NEGOPTYes, I have no bananas.>>

“”

‘Bananas’ was unchecked in the AskOptions listing per our example above. A new !groupname! called ‘!Bananas!’ was established, and its value was set to ‘False’, and the ‘false’ side of the Optional block will remain.

<<*Optional*!Cherries!*Please top my [sundae/milkshake] with a cherry./NEGOPTI don’t want any cherries. They have pits.>>

“”

‘Cherries’ was checked in the AskOptions listing per our example above. A new !groupname! called ‘!Cherries!’ was established, and its value was set to ‘True’. The ‘true’ side of the Optional block will  remain.

 


--Copy above--

 

MenuOptions2Optional

This is what the selection menu would look like when the above text is initially processed.
Not only will Pathagoras assign a value of "1,3" to the GroupName !Fruit!, but it will
automatically assign "True" to !Apples! and to !Cherries! and  "False" to !Bananas!.

You can then use these values anywhere in the document
in the same way any !groupname! is used.

 

_______________________________________________________________

Another Example:

(Can be copied and pasted into document. Press <Alt-P> to process.)

    <<*AskOptions(radio)*!Size!Small/Medium/Large/Custom*>>

   If 'Small' is selected, Pathagoras records the following values for each !Group! it expicitly and implicitly 'sees':

 !Size!="1" (representing it's positional value)

 !Small!="True" (reflecting the actual value selected)

       !Medium!="False"; !Large!="False"; !Custom!="False"  (reflecting that they were not selected)

   If 'Custom' had been selected, Pathagoras would have created the following values

 !Size!="4" (representing it's positional value)

 !Small!="False"; !Medium!="False"; !Large!="False" (reflecting that they were not selected)

 !Custom!="True" (reflecting the actual value selected)

 Optional text blocks placed in the document will be processed accordingly. Example:

 <<*Optional*!Custom!*Please send us the specific measurements  (neck, chest, arm length, waist) so that we can custom tailor your jacket.>>

   If 'Small' was selected for !Size!, the above optional block would be removed from the document when processed. If 'Custom' was selected, the text would remain.

  Simple optional blocks can also be used:

 {!Custom!Please send us the specific measurements  (neck, chest, arm length, waist) so that we can custom tailor your jacket.}

   You do need to be a bit careful in naming. If you use an Options !groupname! that is identical to on of the 'hard' values, the results may not be as you expect.

By way of example:

  <<*AskOptions(radio)*!Grantors!Grantor/Grantors>>

   Following the 'rule,' if the second option ("Grantors") was selected, !Grantors! (initial groupname) would be set to "2", but then Pathagoras would try to set the generated value of !Grantors! to "True".

Consider these naming alternatives

  <<*AskOptions(radio)*!Grantors!Single Grantor/Multiple Grantors>>

or this

   <<*AskOptions(radio)*!Multiple Grantors!Single Grantor/Multiple Grantors>>

or even something as simple as this (just a '?' added to parent !groupname!):

  <<*AskOptions(radio)*!Grantor?!Grantor/Grantors>>