Sometimes you need to set a value within an Ask table. To do so, use the <<*Set*>> command.

   When <<*Set*>>-ing values, you are more or less manually setting values associated with a !groupname!. This is precisely what Pathagoras does when it processes a selection you make from an AskOptions or AskOptional command.

   The formula is "<<*Set*!groupname!=" followed by a value. The value can either be "True", "False","Yes","No,"1","0" or any equation using previously set groupnames. See dog and cat example below.

Consider this:

  <<*AskOptional*!Married!Is our client married?*>>.

When answered, the value assigned to !Married! is either "True" or "False" (or "Yes" or No" (or even more digitally accurate, "1" or "0".

You can directly set this value, avoiding the 'Is our client married?' question altogether (if the situation so calls) in the following manner:

 <<*Set*!Married!="True">>
       <<*Set*!Married!="1">>        is the functional equivalent of the above line. ('1' means 'True' and '0' means 'False'.)


   A more likely application for the use of <<*Set*>> commands is when you want to compare or add (or subtract) the values of one or more existing !groupname! values.

   E.g.,

<<*AskRepeat*!NumCats!*How many cats?>>

<<*AskRepeat*!NumDogs!*How many dogs?>>

<<*Set*!NumCritters!=!NumDogs!+!NumCats!>>


   You can also use a value set by an <<*AskOptions*>> or <<*AskOptions(radio)*>> command to set another value. Here's the setup, based on two MultiChoice lists. The alias of the first MultiChoice list is *States*. It contains 50 elements (the 50 United States of America). The second alias is called *SecType*. It, too, contains 50 elements. The values of these elements are the type of security instrument ('mortgage' or 'deed of trust') associated with each of the 50 States. The goal is to automate the selection of "Deed of Trust' or 'Mortgage', depending upon the state in which the transaction is occurring.

 

   The AskOptions below (first line) sets the value of the groupname !st! to the value the user selects from the list of the 50 States when presented in the Interview. Once the State is selected, Pathagoras can then the value of the groupname called !Security! to the parallel position as the selected state. (So, if Indiana, the 14th position in the list of *States*, is selected, the value of !st! would be '14'. Then Pathagoras processes the !security! groupname by looking at the !st! position in the *SecType*alias list. "Mortgage" occupies that 14th position, and therefore Mortgage is assigned to !security!

<<*AskOptions(radio)*!st!*states**>>

<<*Set*!security! = !st!*SecType**>>


   Less uses of the <<*Set*>> command are the following examples are for advanced users. These users can hard code the values of more complex AskOptions choices so as to pass selected values into the Instant Database tables:
 

  Options (single choice):  

<<*Set*!Spouse!="2(2)">> (The first number reflects the selected position of the choice, and the number in parentheses represents the total number of choices

 
  Options (multiple choices):

<<*Set*!Spouse!="1,3,5(9)">> (where the first numbers, separated by commas, reflect the selected positions of the choices, and the number in parentheses represents the total number of choices

  Numeric/Repeats:

<<*Set*!NumCdn!="5(#)">>(where the first number reflects the number or repeat value, and the pound sign/hash mark tells Pathagoras that an actual number, as opposed to position, is intended.


  informationNote: the <<*Set*>> command is a 'stand alone' command. It is not used in conjunction with an <<*If*>> (shown in previous screens). <<*If*>> equations allow groupnames to be set directly. E.g, see this example from the previous page:

<<*If*!NumCdn!+!NumPets!>5,!CrazyHouse!=”True”,!CrazyHouse!=”False”)>>

 

    Because the result of <<*If* commands may implicitly set a value for another group,  use of the <<*Set* command may be a fairly rare event.

Created with Help & Manual 7 and styled with Premium Pack Version 2.70 © by EC Software