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 reset 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>>

 

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

Yet another example:

The 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?*>>

 

We first proposed that the question be posed as <<*AskOptions* question, instead of a series of <<*AskOptionals*. This is what I suggest:

 <<*AskOptions(radio)*!Finance!Seller finance/Third Party/Two Lenders/Wrap*>> (The radio argument make the choices mutually exclusive.)

 

 There are two very positive effects from this setup. First, it’s shorter and easier to comprehend when presented as a single question.

 

 Secondly, and more importantly to this topic, each option, depending upon its selection, automatically become a usable !groupname! assigned with ‘true’ or ‘false’ values. So if Two Lenders, !Two Lenders! becomes a groupname with a value of ‘True’. !Seller finance! also is turned into a groupname, value = “False”; likewise !Third Party! and !Wrap! are created and assigned the value of  ‘False’.

 

Each new groupname can be used in  <<*Optional* blocks in the body of the document, exactly as you have them currently.

 

The ‘parent’ groupname !Finance! (a multiple choice value) or any newly created groupname can also used elsewhere, whether  further down in the AskTable or in the document body,

 

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 <<*Optional*!Two Lenders!* text text text>>.

 

if some, but just different, text is used, for the various choices, Use <<*Options*!Finance!*aaaa/bbbb/ccccc/dddd>>.

 

(But 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, and the slashes without text between them.

 

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

 

 To add longer explanations to your questions/statement, use 'hover-over text'. See this link.

 

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

New 2021.5

 The 'problem' with the assignment of the individual options to !groupnames! is the length of those resulting groupnames. When each item in the options list is short -- one or two words, it's okay. But frequently the option needs to be longer and, more 'prosaic' for the end user to understand the purpose of the question.

 

 Consider the following list of options:

 

"We will provide support services a no additional cost./We will provide support serves for a flat fee./We will provide support services for hourly rate./We will provide support services on-site/We will provide support services remotely."

 

 Now imagine an optional text block (actually several of them) in the document body where the group name is any of the above choices. First of all, every on exceeds the !groupname! length limit of 39 characters. But irrespective of that, the footprint of each is just too much.

 

 Pathagoras lets you offer a 'prose-like' question or option in the AskTable, but still assign a short (one or two words) phrase as the !groupname! 'optional' using the 'implcit' assignments discussed above. Just add two 'pipes' just inside of the closing '*'  and then list the desired !groupnames!. As always, the groupnames are separated by slashes.  So here is how the above long AskOptions block might look:

 

 <<*AskOptions*!Support!We will provide support services a no additional cost./We will provide support serves for a flat fee./We will provide support services at an hourly rate./We will provide support services on-site/We will provide support services remotely.||support free/support flat-fee/support hourly/support on-site/support remote*>>