$find-words - Filtered word list
$find-words word
$find-words must first be initialized to the required filter string, if the variable is evaluated before it is initialized the value will be set to "ABORT" and the command will fail.
The filter string can contain wild-card characters compatible with most file systems, namely:-
?
[abc]
[a-d]
[^abc]
*
Note that these are not the same characters used by exact(2m) mode.
Once initialized, evaluating $find-words returns the next word found in the main spell dictionaries which matches the filter until no more words are found, in which case an empty string is returned.
The following example finds all the words with "foo" in it (e.g. "footnote"), printing them to the massage line one at a time. Note that &set(4) is used on the !while(4) statement to avoid evaluating $find-words twice per loop.
set-variable $find-words "*foo*" !while ¬ &seq &set #l0 $find-words "" 100 ml-write &cat "Word: " #l0 !done
The order of the words is undefined.
Due to the way words are derived, it is possible to have two or more copies of a word in the dictionary. If this is a matching word $find-words will return the word two or more times.
(c) Copyright JASSPA 1999
Last Modified: 1998/09/03
Generated On: 1999/12/01