Syntax


CUT can be used in a normal Edit session, as well as in File Manager. The operands are similar, but there are some differences


CUT 

(File Manager)

[ CB-name ]

[ REPLACE/REP | NEW ]

[ APPEND/ADD ]

[ RAW ]


CUT

(Edit session)

[ CB-name ]

[ line-control-range ]

[ ALL ]

[ search-string ]     (See special Note below)

[ start-column [ end-column ] ]

[ color-selection-criteria ]

[ PREFIX | SUFFIX | WORD | CHAR ]

[ C ] [ Q ] [ T ]

[ DELETE | DEL ]

[ REPLACE/REP | NEW ]

[ APPEND/ADD ]

[ RAW ]



Operands


CB-name

The name of a Named Private Clipboard. If omitted, the standard Windows clipboard is used. If you use a private name beginning with an Underscore "_", the clipboard will be treated as a temporary clipboard and will be deleted from the CLIP folder after two days.   Using temporary clipboard names helps prevent the \CLIP folder from storing Clip data long after it is still useful.


line-control-range

The range of lines which are to be processed by the command. The full syntax and allowable operands which make up a line control range are discussed in "Line Control Range Specification".


ALL

Note: When optional search criteria are specified,  ALL is assumed, but you may optionally code it anyway.  ALL is only required when NO operands are specified AND no line-range has been marked.


search-string

A string to further filter what lines you desire to be CUT. You may use any of the available string types (normal, Picture, RegEx etc) that are avalable in a FIND command.


Special Note: the search string, even if a simple string like ABC MUST be enclosed in quotes.  e.g. "ABC" This is to prevent it being treated as the CB-Name operand.


start-col 

end-col

These column numbers can be used to further restrict where search-string is allowed to occur.


color-selection-criteria

A request for selection based on the highlight color of the search-string. The full syntax and allowable operands which make up a color-selection-criteria  are discussed in "Color Selection Criteria Specification"


PREFIX

Locates search-string at the beginning of a word.


SUFFIX

Locates search-string at the end of a word.


WORD

Locates search-string when it is delimited on both sides by blanks or other non-Word characters


CHAR

Locates search-string regardless of what precedes or follows it


C

Q

T

C         - Locate the search string within a defined Comment string.

Q        - Locate the search string within a defined Quoted literal string.

T        - Locate the search string within plain text (i.e. Not in a Comment or Quoted string.

You may enter more than 1 of C Q or T to customize the selection. They are tested in an OR relationship.


These three operands require a valid Profile with Colorization active.

DELETE | DEL

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


REPLACE | REP

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.


NEW

If NEW is specified and the CUT is directed to a named clipboard, it requests a verification that the named clipboard does not already exist.  If it does exist, you will be prompted for permission to over-write the existing file.


APPEND | ADD

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


Description


CUT command in File Manager Differences


The CUT command in File Manager has many similarities to the Edit mode CUT command, but also some significant differences.

      • The Line-Control range, ALL, X/NX, U/NU and DELETE options are not supported.
      • The data copied to the clipboard is the full file path, enclosed in Double-Quotes. (Not the contents of the file)
      • Selected lines must be specified via C / CC / Cnn line commands, there are no selection criteria available as operands to the CUT command


In an EDIT session, CUT saves copies of the requested 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.


COPY vs CUT


Windows has used Copy/Cut for years, and we are all familiar with their Windows meaning. 


The SPFLite CUT command name is however a hold-over from the original support in ISPF, We are 'stuck' with the name and the way it functions..


In SPFLite the CUT command can act like either of the Windows COPY/CUT commands. 

How? It depends on how you select the lines.


COPY Mode: 

The lines are selected via C/CC line commands, or text selection criteria, AND you do not specify the DELETE operand.


CUT Mode: 

The lines are selected via:

M/MM line commands

C/CC line commands, or text selection criteria, AND you specify the DELETE operand.


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 putting data into the clipboard.


Specifying the Data to CUT


Two methods of specifying the line range of the selected data are possible.


    • The first is the 'classic' SPF method of specifying line numbers as operands to the CUT command. You have the full range of options allowed by SPFLite's extended line-control-range operands


    • Or, the lines may be marked by C/CC or M/MM  line commands. Depending on whether the X or NX operands are specified, the data CUT will be the entire contents of the specified line range if these operands are omitted, or the specified subset (X or NX) if the operands are specified.


The CUT command also provides for selection based on the contents of the data line. This search ability is similar to what is provided by FIND/CHANGE.  It can be used in conjunction with a specified lne range, or if no line-range is specified it assumes all lines are to be searched.


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:


    • CUT primary command with RAW keyword




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.