TrText_UniqueWords |
Returns all unique words from theText. They are listed in order of appearance and separated by a return.
Syntax
TrText_UniqueWords ( switches ; theText )
Parameters
switches | (optional) determine the way the result is returned |
theText | the text for which the unique words have to be found |
Switches
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 "" |
Returned Result
Data type returned
Text
Result
All unique words from theText, listed in order of appearance and separated by a return.
Originated in
Troi Text Plug-in 1.2
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
This function returns the words in the case in which they appear in the text field. Words that appear both in uppercase and lowercase letters are considered to be different words and both will be returned in the list.
Example
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:
This
is
a
line
this
another
Example 2
If you want a sorted list of all words in a field you can use this calculation:
sortedWords = TrText_SortLines ( TrText_UniqueWords ( "-Unused" ; theText ) )
Related function
TrText_SortLines |
Related topics
Troi Text Plug-in online help (overview)