Chapter 8 - Reference
Question Types
QType Field, part 1

This section discusses the question types that can be specified in the Manager question record’s QType field and are recognized by the Survey program. The following list of question types appears in the drop-down menu of the QType field. The types are discussed in alphabetic order. Click on the individual question type to jump to its explanation.

Samples questions accompany each question type and illustrate how the question record changes with respect to the fields displayed. Fields that are not necessary for the question type disappear. Some of the fields that do appear are discretionary.

Calendar

The Calendar question type is obsolete, see the Functions question type in which all calendar functions have been incorporated.

The Calendar question type manipulates the internal calendar during interviews. There are some 23 different functions available for this type of question. A calendar can be declared, initialized, marked or unmarked; it can be combined with others, or it can be displayed on the screen. Each function is placed in the text field of the question record and has a specific syntax. To see a single example of this question type in the context of the Manager and Survey programs, see "Chapter 7 - Quick Start", Calendar.

All Calendar syntax must have parentheses "()" around the variables and each function must end with a semi-colon (;).

List of Calendar Functions

View a list of calendar functions with a brief explanation of each. To view a detailed description with syntax and examples see the Calendar Functions section.

 

Date Entry

The Date Entry question type collects a date as its answer. The format field must be specified as Date (mdy) or Date (m-y). The date options in the Format field may be changed by the supervisor or project administrator by using the 'Magnifying Glass' icon button on the Main Menu to View Tables. Then choose the Formats table in the View Table field from the drop-down menu and press the View button. Then edit the appropriate field in the Format column.

The convention for date display (e.g., United States, European, military, etc.) may be changed from the Main Menu of the Survey program. Default display is the American convention of month, day, year (MMDDYYYY).

Date formats

An American date value of 10.05.1988 (10/5/98, October 5, 1998) will be stored as 10051988 in the answer file. Manager-Survey dates are year 2000 compliant.

A range of valid dates may be specified in the HardMin, HardMax, SoftMin and SoftMax fields by absolute dates for static range checks or by symbols for dynamic range checks. For details on static and dynamic range specifications, see Chapter 8 - Reference, HardMin and HardMax fields, "Range Specifications".

To see an example of this question type in the context of the Manager and Survey programs, see Chapter 7 - Quick Start, "Date Entry."

 

Dummy Record

The Qtype Dummy Record is not a true question, but provides information to the interviewer in order to continue the interview.

Sometimes the flow of the interview requires giving certain directions to the interviewer or respondent that do not require an answer. The interviewer simply performs whatever those directions tell him or her to do. At other times, the text of the question may be too large to fit in the allocated space and has to be split up into two or more question records.

To see an example of this question type in the context of the Manager and Survey programs, see "Chapter 7 - Quick Start", Dummy Record.

 

Evaluate Expression

The evaluate expression question type evaluates arithmetic or logical expressions and performs a skip accordingly. The expression evaluator can perform computations, with multiple operands and nested expressions. Arithmetical and logical operators may be specified; algebraic and Boolean rules apply. Save-Array symbols may be used. Question names must be enclosed in square brackets. The expression must end in a semicolon (;).

Evaluate Expression questions are executed internally by the program, the interviewer does not encounter them. The result of an Evaluate Expression may be saved in the Save Array if a symbol is assigned in the SaveSym field of the Manager question record. The result of the Evaluate Expression statement in the Text field is not subjected to range checks like the answers to other questions. This is because there would be no way to correct range violations.

The Evaluate Expression question type is used rather than the Translate Answer (becoming obsolete) when the appropriate response is based on some function of the argument, either a logical or algebraic expression or the evaluation is based on more than one previous response. The Evaluate Expression question type return an answer of 1 if the expression is true, or 0 if false.

To see an example of this question type in the context of the Manager and Survey programs, see "Chapter 7 - Quick Start", Evaluate Expression.

Valid Operators

A list of valid operators in Evaluate Expressions statements is shown below. Both the word and the symbol for the operator may be used except for:

'AND' and 'OR' where the word must be used; and
'^' (exponential) where only the symbol is valid.

 

Fixed Answer

The Fixed Answer question type is used to supply a response to a question (and thereby the answer file) when no response from the respondent or interviewer is needed. In this question type, the response is already known and it only needs to be supplied. The nature of the response can be text, integer, symbol, or a question name. It can come from the designer, the Save Array, or a response to a question. It may be used to supply a date for a later comparison, set up a phrase for a text substitution, save a counter as a variable, copy a value to a variable, etc.

To see an example of this question type in the context of the Manager and Survey programs, see "Chapter 7 - Quick Start", Fixed Answer.

 

Functions

The Fucntions question type uses a functional command in the text field of the question record to carry out operations and calculations. Each function has a specific syntax that must be used and special characters (see below) are employed in this syntax. Pay close attention to the syntax of each function. Each command must have its syntax delimited by ( ) and must end in a semi-colon (;).

To view a list of these functions along with a brief explanation of what the function does, click here. The list links each question to it detailed description along with its syntax. Helpful examples and return values accompany each description. Depending on the function used different values are returned as a response to each question. The response values of each function are listed after the examples. Some sample return values are: 1 (Success); -3 (Symbol or question name not found); (-2 Could not complete the function); x (The total number of operations performed); etc. Pay close attention to the return values of each function.

The results of the functional command and syntax specified in this question type should not be confused with the question's response (return values). The results are a consequence of the operation or calculation carried out by the command and they may need to be saved at a symbolic location (%-%) for future reference. These results may be the creation of a calendar, file, roster, pick list, etc; or they may be a clean string of characters, a converted or repaired date, or the initiation and termination of a loop.

Special Characters

In the Manager software and in the Functions question type two characters have special significance:

% is used in pairs to denote that the characters enclosed within are symbols associated with some value stored at this symbolic location.
[ ] are used to enclose question names. Names thus enclosed have values that were collected a responses to these questions.

See Calendar and Keyword Codes for Manager screen examples. Remember to choose Functions in the QType field.

 

Keyword Codes

The Keyword Codes question type is obsolete, see the Functions question type in which all keyword codes have been incorporated.

The keyword code question type is one that employs a primary keyword as a functional command in the text field in order to carry out operations on rosters and the Save Array. Results of keyword questions can change rosters and other Save Array contents and may need to be saved, indexed, and given a symbol as reference.

To see an example of this question type in the context of the Manager and Survey programs, see "Chapter 7 - Quick Start", Keyword Codes.

A List of Keyword Codes with a brief description of their functions and their page location can be found below. The detailed descriptions of the functions are found at their respective page locations.

Special Characters

In the Manager software two characters have special significance:

% is used in pairs to denote that the characters enclosed within are symbols in the Save Array associated with some value stored there.
[ ] are used to enclose question names. Names thus enclosed have values that were collected a responses to these questions.

List of Keyword Codes

View a list of keyword codes with a brief explanation of each. To view a detailed description with syntax and examples see the Keyword Codes section.

 

Multiple Fields

This question type displays more than one field at a time on the screen and it collects multiple data at one time. It can be used to collect names and addresses, hours and minutes, etc. The design of this question is robust and left up to the creativity of the designer.

There are two principal zones on the screen for this question type, TEXT and FIELDS.

Where, "MAIN TEXT ON SCREEN" is the text of the question to be displayed on the screen.
%SYMBOLn% is a symbolic location (e.g., %city%1) where the contents of the field will be stored.
TYPE is the data format of the field. Types are listed below.
INT integer.
LONG long integer.
REAL floating point field.
DATE date.
TIME time.
CHAR character.
DOUBLE/ double precision field. A very large integer. From -999,999,999,999,999 to 999,999,999,999,999.
LENGTH is the length of the field in characters.
"TEXT_FOR_FIELD1" is the on-screen descriptive label for the field, e.g., 'City'.
x,y are optional row and column parameters to place fields in specific row and column locations on the screen.
Example

FIELDS=(%areacode%=CHAR=3="Area Code"=10=1,%phone%=CHAR=08="Phone number"=10=50)

In this example, the areacode field will appear in row 10 and begin in column 1, and the phone number field will also appear in row 10, beginning in column 50.

NOTE: Although the use of row and column positions is optional, once they are used for at least one field in a question, they should be used for every field in that question.

WARNING: Designers must be extremely careful when programming row and column positions to make sure that fields do not run off the survey screen. This type of error will result in a crash. Naturally, multiple fields questions which contain row and column positions should be tested very carefully.

To see another example of this question type in the context of the Manager and Survey programs, see Chapter 7 - Quick Start, "Multiple Fields."

 

Question Types