NIPO ODIN Version 5.17
*FORM
Purpose
Defines a form question.
Syntax
*FORM
Description
This command is always used in combination with *QUESTION and must be specified after this command on the same line. Defines a form question that contains one or more separate input fields that will be dealt with separately on one and the same screen. These fields will either expect numbers or alphanumerical texts of limited length as input.
The commands *NUMBER and *ALPHA determine of which type and how long an input cell is. In the form question there may be descriptive texts that generally precede a cell definition.
It is also possible to create so-called grids, by using *FORM in combination with *SCALE or *GRID .
*FORM questions can be controlled by another question by using the *CONTROL command.
Remarks
- If there is a code in front of the descriptive texts, this code controls in which order the cells are dealt with during the interview. The cell which turn it is will be highlighted. This code is also used to determine which lines are displayed or suppressed by
*CONTROL . - In form questions,
*CONTROL automatically suppresses empty lines that are the result of the control. - You can refer to a field in a form question with the expression
QnFm , where n is the question number and m is the field number (i.e. the order in which they were specified: from the left to the right and then from top to bottom; do not confuse this with the Form cell number in front of the cell, that defines the order in which fields are filled when using the <Tab>). For details, see Form Field References.
Note: If you refer to a field number that is higher than the amount of fields in the form question, the value of field 1 is returned.
Example 1
*QUESTION 1 *FORM *BUT 99 "Refusal" Please, fill in your name and address:
1:Name : *ALPHA 73L30
2:Street: *ALPHA 103L40
3:Place : *ALPHA 143L20
Result:
Example 2
*TAB 30 *TEXTVARS Number, Price, PricePerFax *FONT 0 "10 Arial" *QUESTION 1 *FORM 1:Number of fax machines bought: *NUMBER 61L3 *SAVE Number
2:Total price paid: € *NUMBER 64L4.2 *SAVE Price
*FORMAT 3.2 *PUT PricePerFax [Q1F2 / Q1F1]
*QUESTION 2 *CODES 70L1 *IF [Q1F1 > 1 ] You bought *? Number fax machines for € *? Price?
So the average price per fax machine was € *? PricePerFax ?
1: Yes 2: No
*QUESTION 3 *FORM Number and price of PC's, monitors and printers.
Number Total price
Computers 1:*NUMBER 71L3 4:€ *NUMBER 74L5.2 Monitors 2:*NUMBER 81L3 5:€ *NUMBER 84L5.2 Printers 3:*NUMBER 91L3 6:€ *NUMBER 94L5.2
*PUT PricePerComputer [Q3F2 / Q3F1] *PUT PricePerMonitor [Q3F4 / Q3F3] *PUT PricePerPrinter [Q3F6 / Q3F5]
*** First we want to ask the numbers and then the prices. *** This means that Q3F2 refers to the field that was *** defined second(74L5.2), but will be filled in fourth (4:).
Example 3
*FONT 0 "Arial 10" *QUESTION 1 *CODES 61L6 *MULTI Which of the following brands of beer do you ever drink?
1: Heineken 2: Amstel 3: Grolsch 4: Carlsberg 5: Tuborg
6: None of these *NMUL
*TAB 35, 45, 55, 65, 75, 85 *QUESTION 2 *FORM *CONTROL Q1 W How do you rate the taste of the following beers:
Very poor Very good 1:Heineken *SCALE 67L1 5 6
2:Amstel *SCALE 68L1 5 6
3:Grolsch *SCALE 69L1 5 6
4:Carlsberg *SCALE 70L1 5 6
5:Tuborg *SCALE 71L1 5 6
Result:
|