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 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:
Use of the MOV function generally reflects "bad programming" in the Command Center context; it should (and can almost always) be avoided. A computed question is always preferable.
The MOV function must be the first one to appear in the definition text; for instance, the expression 100+MOV (50, Q3) is not allowed.
Destination questions(s) must have sufficient code width to take the value; if they have a mask, the value will be formatted accordingly.
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:
These functions must be the first to appear in their definition text; for instance, the expression: IF((Q12=01,02,03,99),MST(Q12,Q15) is not allowed.
The destination questions must be given sufficient code width to receive the strings, otherwise the strings might be truncated.)
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:
|
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. |
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:
If the response to the source question is a text string (a name, postal code, etc.) the text is moved)
If the response to the source question is a coded choice, the highlighted label is moved.
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:
|
If the first response to Q1A is choice code RE, the string "Crimson" will be copied to question Q1B. |
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:
|
If the responses to Q1A are choice codes BL and YE, the string "BLYE" will be copied to question Q1B. |
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.