Skip to main content

TrText_CheckSpelling (function reference)

By October 1, 2024October 10th, 2024Online 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 17 to FileMaker Pro 21 (2024)

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 17 to 2024 –> TrText_CheckSpelling (textp4264) 2024-1010 14:41:57