Domanda

For some reason, this code produces the following error:

"Fatal: Syntax error, "BEGIN" expected but "identifier TESTQ" found"

library test;

procedure testp;
begin

end;

procedure testq;
begin

end;

exports
  testp;
  testq;
end.

Here's some sample code that does compile that I found here: http://www.freepascal.org/docs-html/prog/progse54.html

library subs; 

function SubStr(CString: PChar;FromPos,ToPos: Longint): PChar; cdecl; 

var 
  Length: Integer; 

begin 
  Length := StrLen(CString); 
  SubStr := CString + Length; 
  if (FromPos > 0) and (ToPos >= FromPos) then 
  begin 
    if Length >= FromPos then 
      SubStr := CString + FromPos - 1; 
    if Length > ToPos then 
    CString[ToPos] := #0; 
  end; 
end; 

exports 
  SubStr; 

end.

I've come to realize that whenever I use more than one function, procedure, or combination of both, it throws this same error for the exports section. Why does this occur and how can I keep it from happening?

È stato utile?

Soluzione

The exports list should be comma-separated instead:

exports
  testp,
  testq;

end.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top