Explict and Implicit !GroupName! settings (Part 1)

   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.}

 

  NOTE: The automatic assignment of True/False values to the individual members of a Choice group will override a previous assignment of a !group!. Therefore, the name of an individual choice element should not be the same as the parent !groupname!. For example:

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

   If the second option ("Grantors") was selected, !Grantors! (the 'parent' groupname) would initially be set to "2". But when setting the 'true/false' value of each child, Pathagoras would set the 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>>

 

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

Yet another, deeply analyzed, example:

   A user set up a series of 4 <<*AskOptional* questions because she wanted to use parallel <<*Optional* blocks in the document body.

 <<*AskOptional*!Seller Finance!Will the seller finance the purchase?*>>

 <<*AskOptional*!Third Party Finance!Will a third party (bank, mtg co.) finance the purchase?*>>

 <<*AskOptional*!Wrap!Will the seller finance the purchase?*>>

 <<*AskOptional*!Cash Sale!Will the transaction be all cash?*>>

   That is a lot of space used to detemine a single issue -- how will the sale be financed? Using the automatic setting of 'child' !groups! discussed above the questions can be more posed as an <<*AskOptions* block with 4 parts:

 

 <<*AskOptions(radio)*!Financing!Seller finance/Third Party/Two Lenders/Wrap*>>

 

(Note that the 'radio' argument makes the choices mutually exclusive.)

 

   There are two very positive results from using this setup.

 First, and most obvious:  It is significantly shorter and easier to comprehend.

 

Secondly, and more relevant to this topic, each option will automatically become a usable !groupname! assigned with ‘true’ or ‘false’ values.

 

So if 'Two Lenders' (the third choice) is selected, !Two Lenders! instantly becomes a groupname with a value of ‘True’.

 

!Seller finance!, !Third Party! and !Wrap! are likewise instantly created, and each are assigned the value of  ‘False’.

 

The ‘parent’ groupname !Finance! (a multiple choice value) is still set as 3(4).

 

Keep this in mind as you study the example.  

<<*If*!Finance! = “3” . . . .>> is functional equivalent of <<*If* !Two Lenders! = “True”, . . .>>.

 

In the document body, if text will be included for a single choice, but no text is associated with the other choices, consider using <<*Optional*!Two Lender!* text text text>>.

 

If some text is used for each of the the various choices, you can still use the 'parent' group (which was !Financing! <<*Options*!Financing!*aaaa/bbbb/ccccc/dddd>>.

 

Carrying this example to the bitter end,

 <<*Optional*!Two Lender!*text text text>>

 is the functional equivalent of

 <<*Options*Two Lender!*//text text text/>>

Note the use of Options vs. Optional,; the slashes without text between them means 'leave blank'.