Many of the primary commands support line range operands to specify the specific lines which the command is to work on. Rather than repeat these details in each command syntax diagram, whenever the parameter line-range-operand appears, the following operands can be substituted.


Optional Operands


Not all of the operands shown below are necessarily valid with all commands that specify line-range-operands.  e.g. A SHOW command would not support X/NX operands because those attributes are an inherent part of the command's function.


Syntax


[ { .start-label  | .start-line-number } 

 

  [ {.end-label   | .end-line-number } ]   ]


[ :tag  | :\tag  ]     (Where tag may be ZALL to indicate ANY tagname)


[ X | NX ]


[ U | NU ]


Alternative Line Command Specification - CC and MM Blocks


In addition to the line number ranges being specified on the command line, all Primary commands which accept line-range-operand format will also accept the line range via line commands. The C/CC and M/MM line commands can be used to mark the lines to be used and then the primary command entered without a line range specification.


Single character text selection operands


An optional shortcut method is available for entering the line range operands if suitable. When a text area is selected via a mouse-drag operation or via keyboard Shift-arrow keys, the line and column range of the selected text is remembered for future re-use. If you enter the single character # in the command line, it will be substituted with the start/end line numbers of the select block. e.g  # could end up as .20 .30 if that were the previous selected line range.



Operands


start-line-number

This should specify the starting line number of a range. This should be a dotted numeric to distinguish it from the column operand(s). e.g. .123 would describe line 000123.


start-label

This should be a valid label of an existing line to use as the start of range. e.g.   .from.


end-line-number

This should specify the ending line number of a range. This value should be a dotted numeric to distinguish it from the column operand(s). e.g. .456 would describe line 000456.


end-label

This should be a valid label of an existing line to use as end of range. e.g.   .to.


NOTE: If no end-line-number or end-label are provided, the starting line number is treated as a one line range.


:tag

This should be a valid tagname in the file. The 'range' of lines processed will be ALL lines which are currently tagged with the specified tagname. e.g. :XXX would refer to all lines which are marked with the :XXX tagname. You may specify :ZALL to indicate a match of ANY tagname/


:\tag

Requests processing of all lines which do not contain :tag. If you specify :\ZALL it means any line which contains NO tag.


X

This requests the command only process lines which are Excluded (X)


NX

This requests the command only process lines which are NOT Excluded (NX)


U

This requests the command only process lines which are marked as User lines (U)


NU

This requests the command only process lines which are NOT marked as User  lines (NU)


Description


The above operands may be combined to refine your selection.


The following examples should make this much clearer. They are shown using a FIND command, but line range processing applies to many of the Primary commands:


FIND "ABC" 1 10 .AAA .BBB


Find string "ABC" in columns 1 to 10 on lines from the line labelled .AAA to the line labelled .BBB.


FIND "DEF" 3 30 .110 .120


Find string "DEF" in columns 3 to 30 on lines 110 thru 120.


FIND "GHI" .110 .120 :T


Find string "GHI" in lines tagged with :T, in lines 110 thru 120.


FIND "PQR" :QTAG


Find string "PQR" anywhere on any line currently tagged with the tag-name :QTAG.


Processing Order / Priority


When multiple selection operands on a command are chosen, it it important to keep the following in mind, especially so when using the Negative style search commands (NFIND, NEXCLUDE etc.) which can be confusing.


    1. Line-range selection is always performed first. And a failure terminates the command.
    2. Once a line passes line-range selection, and only then, will it be tested against any string comparison tests.


Normal positive tests

For normal tests, ALL entered selection operands are tested in an AND relationship, meaning the First failure terminates the command. To be successful,  ALL tests are performed and must be successful. This is the normal expected handling.


Negative Tests

When performing Negative test commands, a failure in the line-range tests (1. above) will terminate the command, and any string comparison tests are not even performed. This can be trigger unexpected results if you expected all operands to be evaluated.