Desktop User Guides > Professional > Interview scripting > Interview scripting: Getting started > Writing an integer question
 
Writing an integer question
An integer question requires a whole number response; that is, a number without decimals. The Interview Scripting Language calls this a long question.
In this example, we'll write a question that looks like this when you run the interview:
This graphic is described in the surrounding text.
Procedure
1 Enter the question name followed by a space and then the question text enclosed in double quotation marks:
Metadata(en-us, Question, label)
  SurveyTitle "Tea Survey" info;
  Email "Please enter your email address?" text [10..50];
  HowMany "How many cups of tea do you drink in an average week?"
  End Metadata
2 Add the long keyword to specify that this question requires a whole number as its response. (The example shows this keyword on a separate line, but this is for printing purposes only. You can type the keyword on the same line as the question text.)
Metadata(en-us, Question, label)
  SurveyTitle "Tea Survey" info;
  Email "Please enter your email address?" text [10..50];
  HowMany "How many cups of tea do you drink in an average week?"
  long
End Metadata
3 For the purposes of this example, assume that some respondents will not drink tea at all, and that no respondent can drink more than 99 cups of tea in a week. Type the allowed response range enclosed in square brackets. End the question with a semicolon.
Metadata(en-us, Question, label)
  SurveyTitle "Tea Survey" info;
  Email "Please enter your email address?" text [10..50];
  HowMany "How many cups of tea do you drink in an average week?"
  long [0..99];
End Metadata
Requirements
UNICOM Intelligence Professional with Interview Scripting.
Next
Writing a decimal question
See also
Interview scripting: Getting started