TrText_CheckSpelling (function reference)

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

switchesnot used, reserved for future use. Leave blank or put "-Unused"
textthe 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 12 to 16

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 12 to 16 –> TrText_CheckSpelling (textp4264) 2017-1113 11:22:21