Error getting tags :
error 404Error getting tags :
error 404 find | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
find
Basics
Expander triangle
Type
Command
Syntax
find [form] textToFind [in field] find empty
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Searches the fields of the current stack.
Examples

find "heart"
find string "beat must go on" in field "Quotes"

Additional Comments
Expander triangle

Use the find command to search for text.

Parameters:

The form is one of the following words:

* normal

* characters or character (or chars or char)

* words or word

* string

* whole

If no form is specified, the find normal form is used.

The textToFind is any expression that evaluates to a string.

The field is any expression that evaluates to a field reference. If the field is not specified, the find command searches all the fields in the current stack (except fields whose dontSearch property is set to true).

Comments:

The find command starts searching after the previously-found text (if there was a previous find command) or at the beginning of the first field on the current card (if not).

When the search is successful, the card containing the text appears and a box is drawn around the found text. If the text is not found in the stack, the result function returns "Not found".

The six forms of the find command search in different ways. The find normal, find chars, and find words forms search for each word in the textToFind, but the words don't have to be together to be found; they only have to all appear on the same card. The find words and find whole forms look for complete words only. The find string and find whole forms search for the textToFind as a unit.

The find normal form looks for each word in the textToFind at the beginning of a word. For example, find "ring bell" finds "ringing" and "belltower", but not "bring" or "Campbell". All the words you specify must be in fields on the card, but they don't need to be in the same order, or even in the same field.

The find chars form looks for each word in the textToFind, in any part of a word. Unlike the find normal form, the find chars form doesn't require that the words in the textToFind be found at the start of a word on the card. For example, find chars "ring bell" finds "bring", "ringing", "belltower", and "Campbell". As with the find normal form, all the words must be somewhere on the card, but they don't need to be in the same order, or in the same field.

The find words form looks for each word in the textToFind. All the words must be complete words, not parts of words. For example, find words "ring bell" finds "ring" and "bell", but not "ringing", "bring", "belltower", or "Campbell". As with the find normal and find chars forms, all the words must be somewhere on the card, but they don't need to be in the same order, or in the same field.

The find string form looks for the entire textToFind as a unit. Unlike the find normal, find chars, and find words forms, the find string form requires that the textToFind be found exactly: the words must be in the same order and in the same field, and not separated by other words. For example, find string "ring bell" finds "ring bell" and "bring belltower", but not "ring the bell" (extra word between "ring" and "bell"), "Ringbell Street" (no space between "ring" and "bell"), or "bell ringer" (words are in the wrong order).

The find whole form looks for the entire textToFind as a unit. Like the find words form (and unlike the find string form), the find whole form requires that each word in the textToFind be found as a whole word, not part of a word. For example, find whole "ring bell" finds "ring bell", but not "bring belltower" (the "ring" and "bell" are parts of words, not whole words), "ring the bell" (extra word between "ring" and "bell"), "Ringbell Street" (no space between "ring" and "bell"), or "bell ringer" (words are in the wrong order).

Note: Because the find normal, find words, and find whole forms search for words or portions of words, they cannot find a string containing a space. The find string form can find a string containing a space, but cannot find a string that contains a returncharacter.

The find empty form of the find command removes the box from the last word found and resets the find command, so that the next search starts from the beginning of the current card, rather than the location of the next find. Going to another card also resets the find command.

The setting of the caseSensitive property determines whether the search considers uppercase and lowercase characters to be equivalent.

Note: The search does not consider characters that differ by a diacritical mark to be equivalent. For example, find "mére" will not find the word "mere".

Usually, the offset and matchText functions are faster than the find command. But unlike these functions, the find command can search all the fields of a stack at once, instead of one container at a time.

Tip: To perform a batch search, set the markproperty of all cards where a match is found by using the mark cards by finding form of the markcommand.

User Comments
Expander triangle
User thumbnail
sundance@efn.org
StarStarStarStarStar
Feb 4, 2010
find command does not work on variables, only on fields
User thumbnail
Peter Brigham
StarStarStarStarStar
Feb 3, 2011
With the find string form, if the textToFind contains a cr, the result will always be not found. If you wish to search for a string containing a return, you must use the offset() function.