Interface TextControl::addWord

 

Description

In BBj 7.0 and higher, this method adds a word to the server-side custom dictionary file, and marks the word as not misspelled in the spell checked text control.

Syntax

Return Value

Method

void

addWord(string word)

Parameters

Variable

Description

word

The word to be added to the custom dictionary.

Return Value

None.

Remarks

This method marks the word as not misspelled in the text control, and also adds it to the custom dictionary file on the server. To mark the word as not misspelled without adding it to the custom dictionary file, use Interface TextControl::ignoreWord.

Example

rem ' addWord

SYSGUI=UNT
OPEN (SYSGUI)"X0"

sysgui! = BBjAPI().getSysGui()
window! = sysgui!.addWindow(200,200,400,400,"Spell-Check addWord",$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.