Repeat can be used with the ASSIGN command. Repeat lets you apply an ASSIGN command to multiple columns. R is the WinCross command for Repeat.
Note: When using Repeat with the ASSIGN command, the variables must all be the same width. Use View|Data File Information to determine the width for each variable. |
Example 1:
ASSIGN Q2_1 R5 = (1)
means, ‘Assign a value of 1 to 5 consecutive variables starting with variable Q2_1.’
Example 2:
ASSIGN 2/12 R5 = (1)
means, ‘Assign a value of 1 to 5 consecutive columns, on record 2, starting in column 12.’
You can use Repeat for columns that aren't contiguous, but they must be separated by the same number of columns or fields to skip. You specify the number of columns or fields between each column to be tested, using the + symbol to indicate the number of columns to skip before the next Repeat.
Example 3:
ASSIGN Q2_1 R3+1 = (1)
means, ‘Assign the value 1 to three variables, skip one between, starting with variable Q2_1 (variables Q2_2 and Q2_4 would be skipped).’
Related topics: