next previous up contents index
Next: CODEPAGE Previous: CMDSEP Up: The Commands in Detail



CMOVE   [(l1) [l2])] c1 [c2] COLUMN [+|-]col [LINE [+|-]num] [n]
CM

CMOVE means column move, i.e. it moves columns of a line. It should not be confused with the command MOVE, which moves lines.

moves column 5 to column 20 of the current line, moves the columns 5 to 10 to the columns 20 to 25. Note that you do not have to specify the target column, since the number of columns has been set when specifying the source columns.

Moving works as follows: The columns starting with the target column are moved to the right by the number of columns to be moved. The characters to be moved are written into the gap just produced and then deleted at their original place. The gap produced by this is closed again by moving to the left the characters at the right side of the gap. In the example cmove 5 10 col 20 the characters to be moved can afterwards be found in columns 14 to 19, because they have been moved "between" the original columns 19 and 20. This is the same method that is used with the command MOVE, which also does not overwrite but inserts the moved data and leaves no gap at the move source.

Source and target area may not overlap. If they do, you receive the message

Instead of using absolute column specifications you can use relative ones if you add a leading sign to the column specification: has the same effect as the command above.

Until now, the commands were limited to the current line. As usual, you can have the command applied to n following lines by specifying a number as last parameter:

applies the command to 7 lines. If the workfile does not have sufficient lines, you get the message The methods described until now are executed from the current line on. Alternatively, you can also specify the lines you want to be affected as first parameter and enclosed in parentheses: This means, CMOVE will be applied to the lines 500 to 1200, wherever the current line is. The line numbers specified may also be symbolic line numbers (t, f, p, *, n, l, b, s). If you specify only one line number, it is assumed the second line number is equal to the first. Please mind the parentheses.

About the last parameter of CMOVE: Until now, the target columns have been in the same line as the source columns were, but you can also specify the target columns separately:

This moves the columns 5 to 10 of the current line to the columns 20 to 25 of line 700.

As with the COLUMN specification, you can precede the LINE specification with a leading sign, thus making the column specification a relative one:

If the line given cannot be found, you get the message Of course, you can also add the (two alternative) numbers of affected lines: Please keep in mind that you cannot specify a target line that does not exist (yet). So, if you want to move something behind the last line of the workfile, you have to create that (empty) line first.

CMOVE allows for whole rectangles of the workfile to be moved to another part of the workfile.


next previous up contents index
Next: CODEPAGE Previous: CMDSEP Up: The Commands in Detail