TrText_UniqueWords (function reference)

By November 1, 2017November 13th, 2017Online 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 12 to 16

Considerations

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).

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
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 12 to 16 –> TrText_UniqueWords (textp14) 2017-1112 17:24:22