aspell-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Aspell-user] aspell_speller_main_word_list under windows platform


From: tao lin
Subject: [Aspell-user] aspell_speller_main_word_list under windows platform
Date: Mon, 15 Mar 2004 09:31:01 +1300

Hi, all

I just download the GNU Aspell-0.50.3 (win32) from
http://aspell.net/win32/ and try to write a simple app to test some
API functions Aspell provided. Oh, I am using the Delphi so I use the
AspellHeadersDyn.pas too.

The functions be called in sample project works fine. But some other
functions in the API just not working. For example:
aspell_word_list_elements. The code is quite simple, and I believe every c
programmer should understand it.

Here is my code:
============================================================================
==
type
  TWordListType = (wlPersonal, wlSession, wlMain, wlSuggest);

procedure Print_Word_List(const speller: AspellSpeller; const aWordListType:
TWordListType;
  aOutputList: TStrings);
var
  word_ : PChar;    /* A PChar is a pointer to a null-terminated string of
8-bit characters. */
  elements: AspellStringEnumeration;
  Word_List: AspellWordList;
begin
  Word_List := nil;
  aOutputList.Clear;
  case aWordListType of
    wlPersonal: Word_List := aspell_speller_personal_word_list(speller);
    wlSession:  Word_List := aspell_speller_session_word_list(speller);
    wlMain:        Word_List := aspell_speller_main_word_list(speller);
  end;

  if Assigned(Word_List) then
  begin
    elements := aspell_word_list_elements(Word_List);
    repeat
      word_ := aspell_string_enumeration_next(elements);
      aOutputList.Add(word_);
    until (word_ = nil);
  end;
end;
============================================================================
==

In my code,  aspell_speller_personal_word_list &
aspell_speller_session_word_list works fine, but when I call
aspell_speller_main_word_list, I just got the Runtime Error from MS
Visual C++ runtime Library, then my app just terminate.

Could you give me some suggestion about how to use
aspell_speller_main_word_list  please?

-- 
Cheers,
 Tao




reply via email to

[Prev in Thread] Current Thread [Next in Thread]