Color Selection Criteria Specification

Many primary commands support selection criteria based on the highlight color of selected text.  Rather than repeat these details in each command syntax diagram, whenever the parameter color-selection-criteria appears, the following operands can be used.


This means you can choose to find character strings based on whether they are, or are not, displayed in one or more specific colors.


Color operands are used primarily on FIND and CHANGE commands.  Just as you have a choice whether you want to just find data or change it, you have a choice as to whether you just want to look for data in some given color, and/or if you want to change its color.  Note that finding vs. changing the color of your data is performed independently of finding or changing the contents of your data.  


This ability gives you the most flexibility, because the two actions are not dependent on each other.  That is, you can change the color of text using a FIND command, or you can use a CHANGE command to alter the data contents of strings that were found to be of some color without also changing that color.  It's up to you how you want to manage the color of your data.


Be aware that space characters in a file are ordinary data, and can have a color associated with them.  For example, if you issue a command like FIND "ABC DEF" RED, the string will only be found if the entire string is RED, including the space in the middle.  See Shifting Data for information on how this can affect Data Shifting commands involving spaces with nonstandard colors.


Note: Color selection means that you are searching for data that either does, or does not, exist in some particular color.  Color selection occurs when you use a "simple" color name like RED, or a "negative" color name like -RED.  


When you use a color name with a + plus sign, like +RED, it means you want to change the color of any data you are working with.  See the next section, Color Change Request Specification, for more information on how to do this.


Note: Color selection criteria and a color change request can often be combined in the same command, but not in all cases.  Refer to the syntax of the particular command you are interested in to see which color operands, if any, are supported.  Specific color operands are supported only where it makes logical sense to do so.



Standard Color Names


Throughout this description various color names are used.   The names of these colors are Fixed within SPFLite, although the specific colors displayed on the screen are your choice.  See Options - Screen for information about how to specify your preferences for the colors.


Note: You are free, if you so choose, to have the standard color name RED actually display purple on the screen, or for BLUE to display gray, but for most users that would be very confusing.  In all likelihood, you might want a different shade of RED, or have RED as the background instead of the foreground, perhaps a RED that is closer to orange, than something totally different than what RED usually means.


The standard color names are:


RED,  GREEN,  BLUE,  YELLOW,  SOLID and STD


where STD means the standard Foreground / Background colors you have chosen for Text in the Screen tab of SPFLite Global Options

and SOLID means the search string data is entirely of one color, which may be any of Red, Green, Blue, Yellow or STD.



Syntax



[ RED ]  [ GREEN ]  [ BLUE ]  [ YELLOW ]  [ STD ] [ SOLID ]  ...


  |

 

[ -RED ] [ -GREEN ] [ -BLUE ] [ -YELLOW ] [ -STD ] [ -SOLID ]  ...





Operands


color-names

You may specify one or more "simple" color names.  A color name causes a search for text that consists entirely of the named color.  If multiple are specified, they are connected in an OR relationship.  For example, F "ABC" RED means find the string "ABC" only if it is entirely RED.  A request for F "ABC" RED BLUE means to find the string "ABC" only if it is entirely RED or entirely BLUE.


You cannot combine "simple" and "negative" color names on the same command.


-color-names

You may specify one or more "negative" color names.  When color names are entered with a prefix character of - it it means to locate text that does not not consist entirely of the named color.  When multiple - values are entered, they are connected in an AND relationship.  For example F "ABC" -RED -BLUE would look for ABC only when ABC is not entirely RED and not entirely BLUE.


You cannot combine "simple" and "negative" color names on the same command.


SOLID

If SOLID is included in the request, it means the found string must be entirely highlighted in one color.  For example, F "ABCD" SOLID would find the string "ABCD" only if it is found entirely one color, without regard to what particular color that might be.  A string ABCD highlighted half RED and half BLUE would be ignored because it's not one "solid" color.


SOLID is a request to search for a string entirely in one color, including STD.  (Because the other colors RED, BLUE, GREEN and YELLOW are also "solid", if you request SOLID there is no need to request any other "solid" color; that would be redundant.)


[ Note:  Prior editions of this Help implied that the STD color was not found when SOLID is requested.  That information was incorrect.  A "solid" string that is entirely in the standard color is found by SOLID.  This is just a documentation change .]


-SOLID

If -SOLID is included in the request, it means the found string must not be entirely highlighted in one color.  For example, F "ABCD" -SOLID would find the string "ABCD" only if it is found only partially colored, or colored in more than one color, like ABCD.



Description


The following examples should help.  They are shown using a FIND command, but color selection criteria applies to many of the Primary commands:


FIND "ABC" 1 10 BLUE


Find string "ABC" in columns 1 to 10 only if highlighted in BLUE.

That is, find ABC


FIND "DEF" .110 .120 GREEN YELLOW


Find string "DEF" on lines 110 thru 120 only if highlighted in GREEN or YELLOW.

That is, find DEF or DEF


FIND "GHI" SOLID


Find string "GHI" anywhere in the file if it is highlighted in any single color (RED, BLUE, GREEN or YELLOW) or in the default standard color.


FIND "JKL" -RED -BLUE


Find string "JKL" in the file as long as it is not highlighted entirely in RED or BLUE.

That is, if the string is colored as JKL or JKL it will not be found; otherwise it will be found.



Handling of multiple color operands


When multiple "simple" names are used, like RED BLUE, it means that text is searched for that is entirely RED or entirely BLUE.


When multiple "negative" names are used, like -RED -BLUE, it means that text is searched for that is not entirely RED and not entirely BLUE.


Because SPFLite makes these assumptions, you cannot mix these two notations.

 

For example, FIND "JKL" RED -BLUE is an illegal command.  There is actually no need to issue such a command.  Since RED is not BLUE, either you wanted a RED string, or you wanted a string that was anything but BLUE.  So, you should use either RED or -BLUE  but not both.



Application note:  Using SET to assist with color operands


Suppose you wanted to deal with a certain set of color names on a regular basis. You could define a SET symbol and then use it in your command. Suppose you often looked for strings that were either RED or BLUE but you didn't want to type that all the time. Define a symbol for them; let's call it RB:


SET RB = "RED BLUE"


Then, when you want to find strings that are either red or blue, do this:


F 'text' =RB ALL


SPFLite will look up the SET symbol and substitute it in, giving:


F 'text' RED BLUE ALL


The use of SET symbols is nice when you find yourself repeatedly needing the same kind of syntax over and over and don't want to type it in all the time.



Additional Criteria


Many of the primary commands provide additional selection abilities (like X or NX, U or NU 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: Free EBook and documentation generator