CUT - Cut Data to the Clipboard

Syntax


CUT

[ name ]

[ line-control-range ]

[ X | NX ]

[ U | NU ]

[ DELETE | DEL ]

[ REPLACE | APPEND ]

[ RAW ]


Operands


name

The name of a Named Private Clipboard.  If omitted, the standard Windows clipboard is used.


line-control-range

The range of lines which are to be processed by the command.  Line control ranges provide a powerful tool to customize the range of lines to be processed.   The full syntax and allowable operands which make up a line control range are discussed in "Line Control Range Specification".  Refer to that section of the documentation for details.


X | NX

Specifies a subset of the line range to be processed.   X requests only excluded lines are to be examined, NX requests only non-excluded lines are to be examined.   If neither X or NX are specified, all lines in the range will be examined.


U | NU

Specifies a subset of the line range to be processed.   U requests only User lines are to be processed, NU requests only non-User lines are to be processed.   If neither U or NU are specified, all lines in the range will be processed.


DELETE | DEL

Requests that the lines selected for CUT be deleted following the operation.


REPLACE

The data selected by CUT will be placed in the clipboard and will replace any existing data already present.  As noted, REPLACE is the default, and is provided for ISPF compatibility.  Most users will simply omit REPLACE.


APPEND

The data selected by CUT will be added to the end of any existing data already in the clipboard.


Description


CUT saves copies of lines from an edit session to the Windows clipboard, or to a Named Private Clipboard, for later retrieval by the PASTE command or any other Windows application which handles Text-formatted clipboard entries.  


The optional APPEND operand indicates that you wish the selected data to be appended to the current clipboard contents. Without the APPEND operand the clipboard is cleared of any current contents before adding the selected lines.  


See also information on CLIP mode, and Named Private Clipboards, in Windows Clipboard, Cut and Paste.


Note: The CUT command normally copies data to the clipboard (except when M/MM blocks are used, or the DELETE operand; see below).  In general, there is no subsequent deletion of text, as is commonly done in the "cut" function of many word-processing programs.  The command name CUT adheres to the IBM ISPF naming convention for this command, even if it is a bit "inaccurate" of a term.  IBM decided on the command name CUT for ISPF a long time ago, before "cut" and "copy" had the more precise, commonly understood meanings they have today.


The CUT command will do both cutting and copying actions.  If the line range is defined by a C/CC block, or by any type of line-control-range operand on the primary command line, a copy operation takes place.  If the line range is defined by an M/MM block, or the DELETE/DEL operand is specified, a cut operation takes place.  

Bear in mind that the COPY primary command is used for copying outside files into the current edit session, and has nothing to do with the clipboard.  To copy from the clipboard, the PASTE command is required.


Specifying the Data to CUT


Two methods of specifying the data are possible.




The lines are copied from the edit session to the clipboard when the C or CC line commands are used, and are "moved" from the edit session to the clipboard when the M or MM line commands are used (or the DELETE operand).  Moving the lines means that the data on those lines is copied to the clipboard, and then those lines are deleted.  


As noted above, using M/MM automatically performs a true "cut" operation that deletes data afterwards, while defining your line range any other way, such as by using a C/CC block or a line-control-range command-line operand, performs a "copy to the clipboard" operation, analogous to how a Ctrl-C key works in most text editors. A DELETE operand will however always cause the selected lines to be deleted.


Using Raw Mode Copying


You can copy data in what is termed Raw Mode.  Raw mode copy means that there are no End of Line terminators inserted into the copied text.  So, when you copy text that encompasses more than one line, all the text from all of the lines are effectively glued together in one long character string.  This action happens under the following cases:





When you copy text in Raw Mode, you can then go outside of SPFLite and paste the text thus copied as if were a single line, for example, into a Notepad session.  By doing this, you would be able to perform a type of conversion from the kind of individual lines that SPFLite edits to text that may wrap across multiple lines, as editors such as Notepad commonly deal with.


Mapping the CUT and PASTE primary commands


Because the CUT and PASTE primary commands perform a line-oriented copying and pasting of data, similar to how Ctrl-C and Ctrl-V perform a text-oriented copying and pasting of data, many users will want to create key mappings for the CUT and PASTE commands.


In order to be of the most benefit, you may wish to define these mappings so that the current cursor location is saved and restored, so that its location doesn't "jump around" as SPFLite processes these commands.


Here are some suggested key mappings using Alt-C and Alt-V you may wish to try:


Copying lines of text to the clipboard: Use C/CC or M/MM to define the line range first:


Map Alt-C to:        (SaveCursor)(Home)[CUT](Enter)(RestoreCursor)


Pasting lines of text from the keyboard: The key mapping inserts an A line command for you on the current line:


Map Alt-V to:        (SaveCursor)(LineNo)[A](Home)[Paste](Enter)(RestoreCursor)


Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor