4D v14.3

SPELL CHECK TEXT

Home

 
4D v14.3
SPELL CHECK TEXT

SPELL CHECK TEXT 


 

SPELL CHECK TEXT ( text ; errPos ; errLength ; checkPos ; arrSuggest ) 
Parameter Type   Description
text  Text in Text to check
errPos  Longint in Position of first character of unknown word
errLength  Longint in Length of unknown word
checkPos  Longint in Start position for check
arrSuggest  Text array in List of suggestions

The SPELL CHECK TEXT command checks the contents of the text parameter beginning from the checkPos character and returns the position of the first unknown word it finds (if any).

This command returns the position of the first character of this unknown word in errPos and its length in errLength. The arrSuggest array receives the correction suggestion(s) proposed by the spell checker.

If the check starts without error and an unknown word is found, the OK system variable is set to 0. If an initialization error occurs during the check, or if no unknown words are found, OK is set to 1.

Note OS X: Under OS X, when the native spell checker is enabled, this command does not support grammar correction.

Example  

We want to count the number of possible errors in a text:

 $pos:=1
 $errCount:=0
 ARRAY TEXT($tErrors;0)
 ARRAY TEXT($tSuggestions;0)
 Repeat
    SPELL CHECK TEXT($myText;$errPos;$errLength;$pos;$tSuggestions)
    If(OK=0)
       $errCount:=$errCount+1 // count any errors
       $errorWord:=Substring($myText;$errPos;$errLength)
       APPEND TO ARRAY($errors;$errorWord// array of errors
       $pos:=$errPos+$errLength  //continue check
    End if
 Until(OK=1)
  // In the end $errCount=Size of array($errorWord)

 
PROPERTIES 

Product: 4D
Theme: Spell Checker
Number: 1215

The OK variable is changed by the command

 
HISTORY 

New
Created: 4D v13
Modified: 4D v14

 
SEE ALSO 

SPELL ADD TO USER DICTIONARY
SPELL CHECKING

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Inherited from : SPELL CHECK TEXT ( 4D v13.5)