top of page

04. Copy a Repeated Variable

Description

Makes an exact copy of a repeated variable. Copies each answer of one repeated variable into a second repeated variable.

Code

REPEAT FirstRepeat
SET SecondVar[COUNTER] TO FirstVar
END REPEAT


Alternative:
REPEAT FirstRepeat
DEFAULT SecondVar[COUNTER] TO FirstVar
END REPEAT

REPEAT SecondRepeat
SecondVar
END REPEAT

Explanation

The computation steps through the first repeated variable, copying each of its answers to the second variable. COUNTER tells the computation which answer to set. For example, the first pass will give FirstVar's answer #1, or FirstVar[1], to SecondVar[1]. The second pass will set SecondVar[2], etc.

The Alternative uses DEFAULT instead of SET. This allows you to still change the second variable's answers if you want to.

bottom of page