Dear Experts:
We are tring to use in delphi a pas file generated by Free Pascal. The link is at: http://www.markwatson.com/opensource/FastTag_Pascal.zip
While testing, it prompts InValidPointer. Please look at the following error line in debugger.
interface
procedure ReadLexicon;
type sarray = array[1..12] of string;
type big_sarray = array[1..1000] of string; { used for word lists and tags: limit on size of input text }
type psarray = ^sarray;
{function GetTagList(word: string): psarray;}
procedure TagWordList(wordList : big_sarray; var tags : big_sarray);
implementation
uses SysUtils, Classes;
{ Hash Table Support - copied from FreePascal source: benchmork shootout examples }
type
THashEntryPtr = ^THashEntryRec;
THashEntryRec = record
name : string;
number : psarray;
next : THashEntryPtr;
end;
const
TABLE_SIZE = 100000;
...
...
...
function GetTagList(word: string): psarray;
var
ret : psarray;
ok : boolean;
begin
ok := localHash.fetch(word, ret);
if ok then GetTagList := ret else GetTagList := nil;
end;
procedure TagWordList(wordList : big_sarray; var tags : big_sarray);
var i : integer;
x : real;
psa : psarray;
lastThreeChars : string;
lastTwoChars : string;
lastChar : string;
firstTwoChars : string;
tagFirstTwoChars : string;
begin
for i := 0 to length(wordList) do
begin
**psa := GetTagList(wordList[i]);///// EInvalidPointer ERROR**
if psa <> nil then tags[i] := psa^[1] else tags[i] := '???';
end;
...
...
...
How can we fix it. Thank you very much in advance.