Skip to main content

TrText_CheckSpelling (function reference)

By December 1, 2021December 21st, 2021Online Help, Troi Text Plug-in
Troi Text Plug-in > Functions reference > TrText_CheckSpelling
Troi Text Plug-in for FileMaker Pro

TrText_CheckSpelling

Returns the start position and length of the first word which is spelled incorrectly in the text.

SyntaxFunction badge

TrText_CheckSpelling ( switches ; text { ; languageID } )

Parameters

switches not used, reserved for future use. Leave blank or put "-Unused"
text the text to check
languageID (optional) which language to use for the spell check

Returned Result

Data type returned

Text

Result

Returns the start position and length of the first word which is spelled incorrectly in the text.

Originated in

Troi Text Plug-in 4.0

Compatibility

FileMaker Pro 16 to 19

Considerations

Note that the spelling functions are available for Windows 8 and later (and all Mac OS versions).

Example

TrText_CheckSpelling ( "-Unused" ; "a great colour" ; "en-US" ) ]

will result in “9 6”, as “colour” is the first misspelled US English word.

Example 2

Let’s assume you have these 2 fields:

TheText 	text field, contains for example "een mooie voorsteling."
LanguageID	text field, contains for example "nl-NL" for Dutch

In a script you can now get the first word which is spelled incorrectly:

Set Variable [ $Spelling_FirstError ; TrText_CheckSpelling ( "-Unused" ; TheText ; LanguageID ) ]
If [ $Spelling_FirstError <> "" ]
	Set Variable [ $Spelling_FirstErrorWord ; 
			Let ( [ spellingStart = LeftWords ( $Spelling_FirstError ; 1 ) ;
			spellingLength = RightWords ( $Spelling_FirstError ; 1) ] ;
			Middle ( TheText ; spellingStart ; spellingLength ) )
			]

Related functionsFunction badge

TrText_GetSpellingLanguages
TrText_LearnSpelling
TrText_SetSpellingIgnoreList
TrText_UnlearnSpelling

Related topics

Troi Text Plug-in online help (overview)


Online Help Page for Troi Text Plug-in for 16 to 19 –> TrText_CheckSpelling (textp4264) 2021-1221 14:56:12