Returns all unique words from theText. They are listed in order of appearance and separated by a return.
TrText_UniqueWords ( switches ; theText )
|switches||(optional) determine the way the result is returned|
|theText||the text for which the unique words have to be found|
Switches can be empty or:
|-ReturnAtEnd||add a return character at the end|
|-Unused||use this to make clear switches are not used, you can also use ""|
Data type returned
All unique words from theText, listed in order of appearance and separated by a return.
Troi Text Plug-in 1.2
FileMaker Pro 12 to 16
This function ignores the case of the words while comparing. The words returned have the first letter in upper case, the rest lower case (just like Paste from index in FileMaker Pro does).
Set Field [ result ; TrText_UniqueWords ( "-unused" ; theText ) ]
Say text field “theText” consists of the following lines:
this is a line
this is another line
Then the result will be:
If you want a sorted list of all words in a field you can use this calculation:
sortedWords = TrText_SortLines ( TrText_UniqueWords ( "-Unused" ; theText ) )