The <<*Ask. . .*>> Commands

<<*Ask. . .*>> Commands

   Sometimes you want to <<*Ask*>> a question of the end user: Something like: "What type of document do you want?" and "Is this a springing Power of Attorney? and "Are there children?" or "Has condition A, B and C been met?" Based on the answer provided, you want the program to (1) select text to be inserted or (2) set another value (3) ask another question, cascade fashion.

   The <<*Ask. . .*>> series of commands handle this logic.

Types of <<*Ask. . .*>> Commands:

   Four <<*Ask. . .*>> Commands are available in Pathagoras. Collectively they cover the range of possible 'Asks' that an author would need to implement a full Interview (Read more about the structure of Ask commands in the below article called <<*Ask*>> Elements):

  <<*AskOptions*!Children!No children/One child/2+children*>>

  <<*AskOptional*!Minors!Are any children <18 years of age?*>>

   <<*AskRepeat*!NumChildren!How many children?*>>

   <<*AskValue*!Score!What score did the student receive on the test?*>>

 

   <<*Ask. . .*>> commands are in one sense 'parents' to <<*Options*>> and <<*Optional*>> text blocks within the document body that bear the same !GroupName!. (Think here of a parent bird gathering information and feeding it to the chicks. The <<*Ask . . .*>> routines ('parent') gather information 'interview style' and the various responses are assigned to !groupnames!. All items in the document of the same !groupname! (the 'chicks') are fed the answer and processed accordingly.

   There are four other important affiliated commands that bring <<*Ask. . .*>> commands to their full potential. They are briefly described below, with links provided to fuller explanations and examples:

     1. <<*If*>>. This adds powerful logic to an <<*Ask. . .*>> command. It can directly set a value to another !Group! and further process the document, or it can be used to pose another <<*Ask. . .*>>. Here is an example:

<<*If*!Children!="Yes",<<*AskOptional*!Minors!Are there minor children*>>,!minors!="False">>

 2. <<*Set*>>. The Set command can be used to preset default values or to hard code a value in the Ask table (or any other) area of the document..

        <<*If*!Children!="No",<<*Set*!Children!=0(#)*>>,>>

   3. <<*Case*>>. Used to analyze complex Ask structures involving comparison of multiple elements. This is described more fully at this page.  

   4. <<*Remarks*>>. Some AskTables can get long. The 'logic' behing some logic steps may not be apparent to the end user (or to yourself after a lengthy period of time, when you decide you want to further develop the AskTable). Use <<*Remarks* . . . >>add comments and explanations to various sections of your AskTables.

   5. <<*Break*>> Normally Pathagoras will display up to 10 'questions' at a time. <<*Break*>> allow you to say "Stop this group of interview questions here," thereby giving you to better control of those questions.


   Here are a few additional things you should know about <<*Ask. . .*>> commands at the outset.

They are totally optional. If the first appearance of an <<*Options/Optional*>> block in the document provides a prompt that is clear enough for the typical user to make the proper selection, you may choose to not use an <<*Ask*>> command.

<<*Ask. . .*>> commands are typically placed at the top of the document. That way, they can be grouped together to form an 'interview at the start of the assembly process. (It is also easier to edit questions you will be asking your end users when they are grouped together.)

<<*Ask. . .*>> commands are all 'plain text.' As such, you can easily copy a good set of <<*Ask*>> commands from one document to another. Doing so will help you to make the questions uniform from document to document.

If you use <<*Ask. . .*>> commands, you can get rid of the prompts that you may have typed within your <<*Options/Optional*>> blocks. This may result in a significant savings of document 'real estate'.

information<<*Ask* . . .>>, <<*If* . . .>> and <<*Set* . . .>> commands are typically located at the top of the document. That way, it is the first thing that the end-user will encounter during a document assembly session.

   However, <<*Ask* . . .>> commands are usually created last in the Pathagorizing process. The reason is simple: unless you know what the <<*Options . . . Optional . . . Repeats*>> text is in the document's body, you will not know what to even "Ask".

   So as you study and try to mimic the examples on the following pages, please don't even try to create the <<*Ask*>> commands until you have thoroughly composed and tested the routines in the document body. (And because these commands are optional, you certainly don't need them in the initial stages of source document development.)

Benefits of <<*Ask*>> commands:

  When you add prompts to an <<*Options*>> block, the amount of 'real estate' it consumes can be substantial. When that block appears in the middle of a paragraph, it can be difficult to visually process (both to the editor and the end user who may peruse the document before processing it.)

  There is something intangibly better about questions being at the top of, and segregated from the body of, the main text.

  Best reason: Once you have your 'best' questions composed and residing nicely within one of your documents, you can copy and paste an entire collection of <<*Ask*>> commands into any other document containing similar <<*Options/Optional*>> blocks. This assures a consistency in the questions that are posed to the end user.

  For documents-by-building-block aficionados, you can also save the AskTable as a separate clause, calling it in along with other clauses to build, and then process, the document.

  Try that with other programs!

Click the button_next_h button in the menu bar to read more about <<*Ask. . .*>> commands.