Pathagoras Help System

'Case' Logic

Hide Navigation Pane

'Case' Logic

Previous topic Next topic No directory for this topic No expanding text in this topic  

'Case' Logic

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for expanding text JavaScript is required for the print function Mail us feedback on this topic!  

   'Case' logic is a more complex extension of the If/Then/Else logic discussed earlier.  The term 'Case' derives from the sentence "In CASE a certain value(s) is THIS, then do this"

If/Then/Else statements contain  basically two result sections: the True part and the False part. It is 'linear' in structure, reading from left to right, "If this value is X, then do this, else do this.
'Case' logic allows many result sections. It is is 'stacked' in structure, and reads from top to bottom. Example:

Case
   ValueA, A action
   ValueB, B action
   ValueC, C action
   etc.

   When the first true value is reached, the line is processed and the routine ends. The Case list can be endless.

   Case is especially useful for comparing multiple values, and for determining values in a cascading fashion.

   Below is an example that demonstrates how the initial selection of items (in this example, salad fixings) can lead to a cascading of subsequent selections including the salad name and the utensils needed to consume the salad.

   You can  copy and paste this example into a document and process it. Pathagoras will ask you the first question dealing with the salad's "ingredients." If a predesignated combination of ingredients are selected, Pathagoras will automatically determine the proper result. Otherwise, the AskOptions questions (the final entry in the Case list) are presented.

<<*AskOptions*!Ingredients!Celery sticks/Julienne Carrot Strips/Raisins/Apples/Bananas/Cream Cheese*>>

<<*Case*
!Ingredients!= “1,6”,!Salad!=“4”
!Ingredients!= “2,3”,!Salad!=“1”
!Ingredients!= “1,2”,!Salad!=“2”
!Ingredients!= “3,4,5”,!Salad!=“3”
<<*AskOptions*!Salad!Carrot and Raisin Salad/Fruit Salad/Stuffed Celery*>>>>

<<*Case*
!Salad!= “1”,!Utensils!=“2”
!Salad!= “2”,!Utensils!=“2”
!Salad!= “3”,!Utensils!=“3”
!Salad!= “4”,!Utensils!=“4”>>

 
(The top part of this document is the 'Ask Table'. The below is the 'actual' document.

Below are six ‘primary ingredients’ for making a side dish of some sorts.

 

INGREDIENTS:
 

<<*Options*!Ingredients!Celery sticks, / Julienne Carrot Strips, /Raisins, /Apples, /Bananas, /Cream Cheese>>

 

Objective:

We want Pathagoras to select the specific salad (below) if a known combination is selected from among the ingredients above. So, if a pre-determined combination of ingredients is selected, the proper return will be made. Otherwise, Pathagoras will present a question allowing you to manually select the answer. Then, once the kind of salad

 

The type of SALAD made from the above ingredients is:
 

<<*Options*!Salad!Carrot and Raisin Salad/Veggie Salad/Fruit Salad/Stuffed Celery>>

 

For the above side dish, we will need the following UTENSILS:
 

<<*Options*!Utensils!Knife and Fork/Fork/Spoon/Fingers>>

 

r

   Notice that the answers in the Case list are positional. "1,6" refer to the first and sixth positions in the ingredients list (celery and cream cheese).

  Creating a Case Logic List.

1.Display the Logic Wizard (previous section).
2.Make all selections as before, but check the box in the middle of the screen that reads "Create Case Logic Block"
3.After you have created your first Case Logic item, click the Transfer button. The initial formula will be copied into the clipboard and the screen will close. Navigate to the position in the Ask Table where you want the Case Block to appear and click Paste (Ctrl-V).
4.Note: You can only create the structure for the case block, which will consist of the Case title, one (and only one) Case entry PLUS the Ask associated with the primary element selected at the right (this Ask must be the last entry, as it is the 'default item' if no prior Cases are true when document processing occurs).
5.You can (and should) add as many additional 'tests' as you wish, following the pattern shown in the transferred Case Logic Block.