Line Control Range Specification

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.


Syntax



[

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


   [ AND  |  OR ]

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

]


[

 { :tag | Relative-tag }

]


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 of 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 will be either a simple numeric value, or, for those primary commands like FIND and CHANGE that also support column range operands, the value 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.


relative-start-label

This should be a properly formed relative label.  A relative label is one which, between the initial period and the first character of the label name, contains one of the conditional operands of <, >, <=, >=, \, ¬, or <>.  e.g. .<ABC or .<>DD.


The conditional operands have their normal meanings of equal, less than, greater than, less than or equal, greater than or equal, and not equal.  


Note: that when both a start-label and an end-label are specified, and no relative operands are coded, the start-label  is assumed to be coded as >= and the end-label coded as <=. to match prior SPFLite line range conventions.  Together with the default of AND (next topic), this provides the normal range request of 'all lines from :A thru :B.



AND  |  OR

You may optionally code AND or OR between the start and end label references.   If you code neither, AND is always assumed.


This enables you to code requests such as:


.<ABC OR .>DEF


which would request all lines before .ABC and all lines after .DEF


end-line-number

This should specify the ending line number of a range.   This will be either a simple numeric value, or, for those primary commands like FIND and CHANGE that also support column range operands, the 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.


relative-end-label

This should be a properly formed relative label.  A relative label is one which, between the initial period and the first character of the label name, contains one of the conditional operands of <, >, <=, >=, \, ¬, or <>.  e.g. .<ABC or .<>DD.


The conditional operands have their normal meanings of equal, less than, greater than, less than or equal, greater than or equal, and not equal.


: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.


relative-tag

This should be a properly formed relative tag.  A relative label is one which, between the initial colon and the first character of the label name, contains one of the conditional operands of =,  \, ¬, or <>.  e.g. :=ABC or :<>DD.  Note that because tag-names can be present on multiple lines in the file, only equal and not equal conditions can be specified.


The conditional operands have their normal meanings of equal and not equal.


Description


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 labeled .AAA to the line labeled .BBB.


FIND "DEF" 3 30 .110 .120


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


FIND "GHI" 3 30 .110 .120 :T


Find string "GHI" in columns 3 to 30 on lines tagged with :T, in lines 110 thru 120.


FIND "JKL" .<PROC


Find string "JKL" anywhere on lines from the top of file up to the line preceding the line labeled .PROC.  i.e. the range requested is all lines whose line number is less than the line labeled .PROC.


FIND "MNO" 3 8 .>=CC .<=DD


Find string "MNO" in columns 3 to 8 on lines from the line labeled .CC to the line labeled .DD inclusive.


FIND "PQR" :XTAG


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


FIND "STU" :¬BG


Find string "STU" anywhere on any line not currently tagged with tagname :BG.  

The tag notation :¬BG can also be specified as :<>BG or :\BG , and all of these have the same meaning.


Additional Criteria


Many of the primary commands provide additional selection abilities (like the X|NX and U|NU keyword operands) which work in conjunction with the normal action of the line range operands described above.  Check the detailed description of the individual primary command.


Created with the Personal Edition of HelpNDoc: Full-featured EBook editor