Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.AddSpellCheckWord


Name AddSpellCheckWord
Type Method
Summary Adds a word to the user spell check dictionary
Prototype long AddSpellCheckWord(BSTR OriginalWord, BSTR ActionCode, BSTR ReplacementWord);
Description

This lets you add a word to the spell checker "user dictionary" from within a script.

Usage:

result = AddSpellCheckWord (original_word, action, replacement)

original_word = word to match on

action = one of the following single characters (case-sensitive):

'a' = The word should be unconditionally substituted for another word; the substitution should use the case pattern as listed in the lexicon.

'A' = The word should be unconditionally substituted for another word; the substitution should use the case pattern of the original word.

'c' = The word should be conditionally substituted for another word; the substitution should use the case pattern as listed in the lexicon.

'C' = The word should be conditionally substituted for another word; the substitution should use the case pattern of the original word.

'e' = The word should be treated as misspelled by the spell checker, even if it is defined in other lexicons.

'i' = The word should be ignored (skipped) because it is considered correctly spelled.

replacement = the word to replace (or suggest a replacement for) the original word

eg.

AddSpellCheckWord ("foo", "A", "bar") --> convert "foo" to "bar"
AddSpellCheckWord ("colour", "i", "") --> "colour" is spelt correctly


Note: Available in version 3.74 onwards.


VBscript example
AddSpellCheckWord "foo", "A", "bar"  ' convert "foo" to "bar"
AddSpellCheckWord "colour", "i", ""  ' "colour" is spelt correctly
Lua example
AddSpellCheckWord ("foo", "A", "bar")  --> convert "foo" to "bar"
AddSpellCheckWord ("colour", "i", "")  --> "colour" is spelt correctly
Lua notes
The third argument (replacement word) is optional and defaults to an empty string.
Returns eSpellCheckNotActive - spell checker not enabled or could not be opened

eBadParameter -

original_word not supplied or too long (more than 63 characters); or
replacement word too long (more than 63 characters); or
error returned from spell-check engine

eUnknownOption - action code not in the above list

eOK - did it OK
Introduced in version 3.74

See also ...

Function Description
SpellCheck Spell checks an arbitrary string of text
SpellCheckCommand Spell checks the text in the command window

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.