Interface TextControl::getMisspelledWords

 


Description

In BBj 7.0 and higher, getMisspelledWords returns a BBjVector containing all unique words currently marked as misspelled in a spell-checked text control.

Syntax

Return Value

Method

BBjVector

getMisspelledWords()

Parameters

None.

Return Value

Returns a BBjVector containing all words currently marked as misspelled.

Remarks

Any given word will only appear once in the BBjVector, even if it is misspelled multiple times in the text control.

Example

rem ' getMisspelledWords

SYSGUI=UNT
OPEN (SYSGUI)"X0"

sysgui! = BBjAPI().getSysGui()
window! = sysgui!.addWindow(200,200,400,400,"Spell-Check getMisspelledWords",$00010003$)
cedit! = window!.addCEdit(102,25,50,350,325,"",$0100$)
cedit!.setLineWrap(1)

gosub InitText

Locale$ = stbl("!LOCALE","en_GB")
cedit!.setCustomDictionary("Jabberwocky.dic")
cedit!.setSpellChecked(1)

words!=cedit!.getMisspelledWords()
if words!.size() then
:  for word=0 to words!.size()-1;
:      word$ = words!.get(word);
:      print "Add to "+cedit!.getCustomDictionary()+": "+word$;
:      cedit!.addWord(word$);
:  next word

CALLBACK(ON_CLOSE,APP_CLOSE,sysgui!.getContext())

REM Process Events
PROCESS_EVENTS

APP_CLOSE:
RELEASE

InitText:
  Text! = new java.util.HashMap()
  while 1
    dread text$,err=*break
    cedit!.addParagraph(-1,text$)
  wend
return

data "'Twas brillig, and the slithy toves"
data "  Did gyre and gimble in the wabe:"
data "All mimsy were the borogoves,"
data "  And the mome raths outgrabe."
data ""
data ""Beware the Jabberwock, my son!"
data "  The jaws that bite, the claws that catch!"
data "Beware the Jubjub bird, and shun"
data "  The frumious Bandersnatch!""
data ""
data "He took his vorpal sword in hand:"
data "  Long time the manxome foe he sought --"
data "So rested he by the Tumtum tree,"
data "  And stood awhile in thought."
data ""
data "And, as in uffish thought he stood,"
data "  The Jabberwock, with eyes of flame,"
data "Came whiffling through the tulgey wood,"
data "  And burbled as it came!"
data ""
data "One, two! One, two! And through and through"
data "  The vorpal blade went snicker-snack!"
data "He left it dead, and with its head"
data "  He went galumphing back."
data ""
data ""And, has thou slain the Jabberwock?"
data "  Come to my arms, my beamish boy!"
data "O frabjous day! Callooh! Callay!'"
data "  He chortled in his joy."
data ""
data "'Twas brillig, and the slithy toves"
data "  Did gyre and gimble in the wabe;"
data "All mimsy were the borogoves,"
data "  And the mome raths outgrabe."

See Also

BBjAPI

BBjSysGui

BBjControl

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.