Can someone recommend a good tool, utility or method for spell checking a column that is a varchar(5000)? I found the example for using Excel, but it is limited to 255.
We use one Called Sentry Spell Checker - distributed as .DLL and very easy to implement - been using it for several years now, so our version's probably a bit out of date. See
We've implemented a user object with one function:
public function string uof_spellcheck (string instring)
takes string argument to be checked returns checked / corrected string.
A PB 6.5 Export of nvo :
$PBExportHeader$uo_spell_check.sru
forward
global type uo_spell_check from nonvisualobject
end type
end forward
global type uo_spell_check from nonvisualobject
end type
global uo_spell_check uo_spell_check
type prototypes
FUNCTION long SSCE_CheckBlockDlg(int Whatwin, REF string thistest, long oldlength, long newlength, int showcontext) LIBRARY "SSCE5232.DLL"
FUNCTION long SSCE_SetMainLexPath(string Pathvar) LIBRARY "SSCE5232.DLL"
FUNCTION long SSCE_SetUserLexPath(string Pathvar) LIBRARY "SSCE5232.DLL"
FUNCTION long SSCE_SetMainLexFiles(string Pathvar) LIBRARY "SSCE5232.DLL"
FUNCTION long SSCE_GetMainLexFiles( REF string LexFiles, long length ) LIBRARY "SSCE5232.DLL"
SUBROUTINE SSCE_ResetLex() LIBRARY "SSCE5232.DLL"
end prototypes
forward prototypes
public function string uof_spellcheck (string instring)
end prototypes
public function string uof_spellcheck (string instring);int retval,blklen,newlen
string block,outstring
// has the effect of ensuring the spellcheck DLL is loaded
if NOT gb_spell_lib_loaded then
SSCE_ResetLex()
gb_spell_lib_loaded = true
end if
block = Instring
blklen = Len(block)
block = block + space(blklen/5)
ls_UserLexPath = g_nv_ini.fnv_profile_string( "SSCE", "UserLexPath", "none" )
if ls_UserLexPath <> "none" then SSCE_SetUserLexPath( ls_UserLexPath )
ls_MainLexPath = g_nv_ini.fnv_profile_string( "SSCE", "MainLexPath", "none" )
ls_LexFiles = space(128)
SSCE_GetMainLexFiles( ls_LexFiles, 128 )
if pos( upper( ls_LexFiles ), 'SSCEBR' ) = 0 then
if ls_MainLexPath <> "none" then
SSCE_SetMainLexPath( ls_MainLexPath )
ls_FullPath = ls_MainLexPath
if right( ls_MainLexPath, 1 ) <> "\" then ls_FullPath += "\"
if NOT FileExists( ls_FullPath + "sscebr.lex" ) then
MessageBox( "Error", "File SSCEBR.LEX not found in directory " + ls_MainLexPath + "~nSpell checker will not work properly." )
else
SSCE_SetMainLexFiles( "sscebr.lex" )
end if
else
MessageBox( "Error", "ini file entry [SSCE] MainLexPath is missing.~nCannot assign main lexical files." )
end if
elseif ls_MainLexPath <> "none" then
ls_FullPath = ls_MainLexPath
if right( ls_MainLexPath, 1 ) <> "\" then ls_FullPath += "\"
if NOT FileExists( ls_FullPath + "sscebr.lex" ) then
MessageBox( "Error", "File SSCEBR.LEX not found in directory " + ls_MainLexPath + "~nSpell checker will not work properly." )
end if
end if
I found the following thread on a Powerbuilder forum from back in 1999.
- Matt
<message below>
Message 1 in thread
From: eric chung (saifaic@hkstar.com)
Subject: spell check with MsWord, not Excel
Newsgroups: powersoft.public.powerbuilder.ole-ocx-activex
View this article only
Date: 1999/03/01
Hi all,
I use multiLineEdit to contain the text what I typed and I want to use
spellcheck function with MsWord to change the wrong spelling at
multiLineEdit without display word document. Is there any samples ?
thanks a lot.
Eric
Message 2 in thread
From: Ajomon Joseph (ajoseph@sorosny.org)
Subject: Re: spell check with MsWord, not Excel
Newsgroups: powersoft.public.powerbuilder.ole-ocx-activex
View this article only
Date: 1999/05/11
Try this:
Note: You must have word in your machine. If it works replay.
/*====================================================================*/
string sDoc
If gs_current_text = "" then Return
/*place the text in clipboard from current column*/
If Clipboard(gs_current_text) = "" Then RETURN
//OleObject MyOleObject
MyOleObject = CREATE OLEObject
If MyOleObject.ConnectToNewObject("word.application" <> 0 Then Return
> Hi all,
> I use multiLineEdit to contain the text what I typed and I want to use
> spellcheck function with MsWord to change the wrong spelling at
> multiLineEdit without display word document. Is there any samples ?
> thanks a lot.
>
> Eric
Message 3 in thread
From: Oliver Willandsen [European Commission] (oliver.willandsen@PAS_DE_PUBsg.cec.be)
Subject: Re: spell check with MsWord, not Excel
Newsgroups: powersoft.public.powerbuilder.ole-ocx-activex
View this article only
Date: 1999/05/11
On Tue, 11 May 1999 10:10:01 -0400,
in powersoft.public.powerbuilder.ole-ocx-activex
Ajomon Joseph <ajoseph@sorosny.org> wrote:
>Try this:
>Note: You must have word in your machine. If it works replay.
>/*====================================================================*/
>string sDoc
>
>If gs_current_text = "" then Return
>
>/*place the text in clipboard from current column*/
>If Clipboard(gs_current_text) = "" Then RETURN
>
>//OleObject MyOleObject
>
>MyOleObject = CREATE OLEObject
>
>If MyOleObject.ConnectToNewObject("word.application" <> 0 Then Return
>
>myoleobject.Application.Visible = False
>
>myoleobject.Application.WindowState = 2
>
>myoleobject.Application.Documents.Add.Content.Paste
>
>myoleobject.Application.ActiveDocument.CheckSpelling
>
>myoleobject.Application.ActiveDocument.Content.Copy
>
>myoleobject.ActiveDocument.Close(0)
>
>
>myoleobject.Application.Quit
>
>MyOleObject.disconnectobject()
>
>//Destroy Shared Variable OleObject
>Destroy MyOleObject
>
>
>messagebox("Information", "The spelling and grammer check is complete."
>
>/*re-place the text in current column with text from clipboard */
>gs_current_text = Clipboard()
>
>/*====================================================================*/
>
>
>eric chung wrote:
>
>> Hi all,
>> I use multiLineEdit to contain the text what I typed and I want to use
>> spellcheck function with MsWord to change the wrong spelling at
>> multiLineEdit without display word document. Is there any samples ?
>> thanks a lot.
>>
>> Eric
>
Or alternatively, if you don't want to use the clipboard :
// public function boolean of_spellcheck (powerobject apo_spellcheckobject,
string as_language)
// replace 'This' with you_oleobject if you're not actually _in_ the
// oleobject !!
CHOOSE CASE apo_spellcheckobject.TypeOf( )
CASE datawindow!
ldw_sheet = apo_spellcheckobject
ls_oldtext = ldw_sheet.GetText( )
CASE multilineedit!
lmle_object = apo_spellcheckobject
ls_oldtext = lmle_object.Text
CASE singlelineedit!
lsle_object = apo_spellcheckobject
ls_oldtext = lsle_object.Text
CASE ELSE
MessageBox( "ERREUR", "This object can not be spellchecked" )
RETURN FALSE
END CHOOSE
// create a new document
This.Application.Documents.Add ()
// insert text to be spell-checked
This.Selection.InsertAfter( ls_oldtext )
//Choose Case li_countrycode
// Case 1043
// Messagebox("Taal", "Nederlands"
// Case 1036
// Messagebox("Langue", "Français"
// Case 1031
// Messagebox("Sprache", "Deutsch"
// Case 2057
// Messagebox("Language", "UK English"
// Case 1033
// Messagebox("Language", "US English"
// Case Else
// Messagebox("Language", "Unknown"
//End Choose
CHOOSE CASE as_language
CASE 'DK'
This.Selection.LanguageId( 1030 )
CASE 'NL'
This.Selection.LanguageId( 1043 )
CASE 'EN'
This.Selection.LanguageId( 2057 )
CASE 'FI'
This.Selection.LanguageId( 1035 )
CASE 'FR'
// This.Selection.LanguageId( 1036 )
CASE 'DE'
This.Selection.LanguageId( 1031 )
CASE 'GR'
This.Selection.LanguageId( 1032 )
CASE 'IT'
This.Selection.LanguageId( 1040 )
CASE 'PT'
This.Selection.LanguageId( 2070 )
CASE 'ES'
This.Selection.LanguageId( 1034 )
CASE 'SU'
This.Selection.LanguageId( 1053 )
CASE ELSE
This.Selection.LanguageId( 1036 )
END CHOOSE
// invoke the spellchecker
CHOOSE CASE as_language
CASE 'FR', 'EN'
la_spellcheck_returncode = This.ActiveDocument.CheckGrammar()
CASE ELSE
la_spellcheck_returncode = This.ActiveDocument.CheckSpelling()
END CHOOSE
If IsNull( la_spellcheck_returncode ) Then
This.ActiveDocument.Content.Select
This.Selection.MoveLeft( 1, 1, 1 )
ls_spellchecked = This.Selection.Text
// copy the spellchecked selection back to the calling object
CHOOSE CASE apo_spellcheckobject.TypeOf( )
CASE datawindow!
ldw_sheet.SetText( ls_spellchecked )
CASE multilineedit!
lmle_object.Text = ls_spellchecked
CASE singlelineedit!
lsle_object.Text = ls_spellchecked
END CHOOSE
End If
// close the active document
This.ActiveWindow.Close( 0 )
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.