RESET Statements

RESET statements are used to return the interview to a previously asked question. This could be a question that caused the interviewer to enter a response, a data-generating question (GENERATE or EXPRESSION), or a labeled compiler directive. Data is removed from all questions asked between the RESET statement and the question reset to. This is generally used if some mistake in logic has been detected and you wish the interviewer to re-ask a set of questions. You can also use this to format your own error messages and re-ask a question in places where the standard error messages will not suffice.

The syntax for a RESET statement is:

!RESET,label or -#

Using -#

If you specify a dash followed by a number (from 1-27), Survent will go back that many answered questions.


!RESET,-5 }

This will reset back five questions (the last five answered/executed). This is very useful in a Terminate block, where if the interviewer really shouldn’t have terminated, you can programmatically back them up to where they were when they mistakenly entered the block.

Using a Label

RESET statements usually have an IF condition, i.e., the interview would only be returned to the specified question if the condition was true.


!IF COST<=10

If the question COST has a numeric response less than or equal to 10, the program will immediately return to the question called FIRST, removing previous responses between FIRST and NEXTQ.

A RESET statement usually includes some text with a message to the interviewer. If you include text, the interviewer will have to press Enter before the program resets.


!IF USE(2)
The respondent uses \:BRAND: brand, re-ask questions.
Press Enter or click Next to continue.

If question USE has a response of 2, the interviewer will see a screen with the above text. This text displays the brand name chosen. The program does not display instructions to the interviewer, so you may want to include instructions in the question text, like pressing enter or next to continue. The program will then return to question NEWBRAND, removing any responses to questions between QNEW and NEWBRAND.

With RESET statements there are a few rules to keep in mind:

  • The question that is returned to must have been asked previously.
  • When Survent resets to a question, the program deletes the response to the returned “to” question and all subsequent responses, restoring the data to its state before this question was first asked.
  • If you use a RESET statement to go forward, it acts like a GOTO statement.
  • You may not use a RESET statement to move into or out of a SUSPEND, RESUME or SPECIAL block.