Skip to main content

TrText_UniqueWords (function reference)

By October 1, 2024October 10th, 2024Online Help, Troi Text Plug-in
Troi Text Plug-in > Functions reference > TrText_UniqueWords
Troi Text Plug-in for FileMaker Pro

TrText_UniqueWords

Returns all unique words from theText. They are listed in order of appearance and separated by a return.

SyntaxFunction badge

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 functionFunction badge

TrText_SortLines

Related topics

Troi Text Plug-in online help (overview)


Online Help Page for Troi Text Plug-in for 17 to 2024 –> TrText_UniqueWords (textp14) 2024-1010 14:51:32