Condition Statements

You may wish a question to be asked (or a statement executed) only if some condition is true. The condition statement lets you specify exactly what must be true in order for Survent to do the operation. You may use a previous question’s response(s) or data to control the execution of any type of question or control statement.

Condition statements are also called IF statements (“If this is true, then do this operation.”).

Condition statements follow the question label line, and start with an !IF statement followed by one or more references connected by logical operators. Labels, question numbers and data locations may be used as the references. Parentheses are used to separate parts of complex logic conditions or calculations.

You can have up to 32,000 characters in an IF statement. Use an ampersand (&) at the end of the line to continue an IF statement to another line.

NOTE: Comparisons using =, < >, >=, and <= operators require that both sides of the equation match for type, and they must be either numeric or string variables. You can force this to work by putting brackets ( [ ] ) around a VARIABLE type variable, for example, which converts the type to numeric or putting brackets and a dollar sign ([numtype $]) around a numeric type variable for a string comparison.