Advanced Functions

Most questionnaires can be implemented effectively without the use of the advanced functions described in this section. However, there are special situations requiring manipulations that might be difficult to carry out in a straightforward manner. The MOV, MLB, MST and MVC functions, which address these special cases, are intended for users with programming skills.

The MOV function

The MOV function may be used to fill one or more questions with a numerical value. It must be used in the definition part of a computed question (skip to *, see Computed Questions). The general syntax is:

MOV (expression, list of destination questions)

Example

Explanation

Skip to * if MOV (99, [Q1-Q10])

Places a value of 99 into questions Q1 to Q10.

Skip to * if MOV (SUM ([Q1-Q10]), TOTAL)

Places the sum of questions Q1 to Q10 into the question named TOTAL.

Skip to * if MOV ($T, T5)

Places the current elapsed time into question T5.

Important:

The MLB, MST and MVC functions - copying strings

Three operators are available for copying strings into a list of questions:

MLB (numeric expression, destination question or list of questions)

MST (source question, destination question or list of questions)

MVC (source question, destination question or list of questions)

Important:

The MLB function

This function copies the choice label from the current question whose code is selected through the value returned by the first argument.

Example

Explanation

Skip to * if

MLB (V01(QA=99)+V01(QB=99),[Q1-Q10])

Assume that this question has mask $E and code width of 2.

Choices are:

Code

Label

00

Never

01

Once

02

Twice

This moves one of the labels Never, Once, or Twice into questions Q1 through Q10, according to the number of occurrences of the 99 code in questions QA and QB.

The MST function

This function copies a string from another question into one or more listed questions. The rules governing which string will be moved are the same as those for a recall within < > ("fill"). Therefore:

  1. If the response to the source question is a text string (a name, postal code, etc.) the text is moved)

  2. If the response to the source question is a coded choice, the highlighted label is moved.

  3. If the source question is coded, and a code with the O attribute was selected, the Open-ended part is moved.

Note: In the case of a multiple response question, the above rules apply to the first response only

Example

Explanation

Skip to * if MST(Q1A, Q1B)

Assume that there is question Q1A with the following choices:

Code

 Label

YE

Golden

BL

Aquamarine

RE

Crimson

If the first response to Q1A is choice code RE, the string "Crimson" will be copied to question Q1B.

The MVC function

This function copies the coded content from another question into one or more listed questions without interpretation of the content.

Example

Explanation

Skip to * if MVC(Q1A, Q1B)

Assume that there is question Q1A with the following choices:

Code

 Label

YE

Golden

BL

Aquamarine

RE

Crimson

If the responses to Q1A are choice codes BL and YE, the string "BLYE" will be copied to question Q1B.

The CLR and CLC functions

The CLR function clears the responses to a list of questions, including their open-ends. If the questions are within a roster, the cleared rows depend on the point from where the function has been invoked – similar to the CSM function. The cleared fields are set to blank, and their value set to zero.

The CLC function fills each question in the list with its choice code bearing the C attribute. Relevant recalls are updated accordingly.

Example:   

CLC (Q3, Q5, [Q23A-Q23J])

Warning: If a specified question does not have a choice code bearing the C attribute, its content will be erased.

Note: Globally disabling automatic cleaning does not disable the CLR and CLC functions.