SEARCH

SEARCH

Top  Previous  Next

 

The SEARCH verb is similar to SELECT except that it also prompts for entry of one or more text strings. Records that meet any other selection criteria given on the command line are tested for the presence of the search strings at any position in the record.

 

SEARCH {DICT} file.name

{USING {DICT} file.name}

{selection.clause}

{sort.clause}

{record.id...}

{ALL}

{FOR string1 string2 ...}

{NO.CASE}

{FROM select.list.no}

{STRINGS file.name record.id}

{SAVING {UNIQUE} {MULTI.VALUE} field.name {NO.NULLS}}

{DISPLAY}

{TO select.list.no}

 

Multiple search strings may be specified. The default action is to prompt for entry of search strings, terminating the list by entering a blank response to the prompt. Two  alternative methods of specifying the search strings are available. Use of the FOR keyword allows search strings to be specified on the command line. Use of the STRINGS keyword takes the search strings from the specified file and record, each field being taken as a separate search string.

 

The default action is for the search to scan only the record data. Use of the ALL keyword extends the search to include the record id.

 

The optional NO.CASE keyword makes the search string test case insensitive.

 

By default, the SEARCH verb builds a list of all records that contain any of the supplied search strings. This can be changed by use of the ALL.MATCH or NO.MATCH keywords. The ALL.MATCH keyword specifies that the selected records must contain all of the supplied strings. The NO.MATCH keyword specifies that the selected records must not contain any of the supplied strings.

 

Use of the DISPLAY option causes the command to show the line number and content of each line that contains any of the search strings. No select list will be generated unless the TO option is also used. The DISPLAY option cannot be used with NO.MATCH. The SCAN command is equivalent to SEARCH with the DISPLAY option.

 

All other options of the SELECT verb may be used in SEARCH.

 

 

Examples

 

SEARCH BP

String: !SORT

 

The above lines entered at the keyboard would search all QMBasic source programs in the BP file for references to the !SORT() subroutine and build a select list of these records.

 

SEARCH BP DISPLAY FOR "!SORT"

 

The above command would search all QMBasic source programs in the BP file for references to the !SORT() subroutine and display the lines on which they occur.

 

 

See also:

ALL.MATCH, NO.CASE, NO.MATCH, SCAN