Hello, sorry if this is a trivial question.
I´d like to use dzcomm library in my pascal program. It is necesary to first initialize allegro:
///****************************************// program Terminal;
{$L c:\djgpp\allegro\src\allegro.c}
function allegro_init() : integer; asmname 'allegro_init'; external;
begin allegro_init(); Writeln('Hola, esta es una prueba.'); readln; end. ///****************************************//
but the gpc says:
C:\DJGPP\allegro\dzcomm\term>gpc term2.pas --autobuild term2.pas:5: parse error before `)' term2.pas: In main program: term2.pas:8: parse error before `)' term2.pas:8: warning: function call as a statement - value is ignored
What I am doing wrong?, or what switches do I have to set?
Thank you for your help.
Miguel Pérez E Development Engineer Primestone E-Mail: miguel.perez@primestone.com Tel: (571) 6265432 Fax: (571) 6156377
In pascal (unlike C and many other languages) you don't need (and apparently shouldn't) use empty brackets after the function name if it does not have arguments. The keyword allegro_init is explicitly stated to be a function and parser clearly expects an argument here. So your declaration should be: function allegro_init:integer;asmname ...
George
On Thu, 2 Aug 2001, [iso-8859-1] Miguel P�rez E wrote:
Hello, sorry if this is a trivial question.
I�d like to use dzcomm library in my pascal program. It is necesary to first initialize allegro:
///****************************************// program Terminal;
{$L c:\djgpp\allegro\src\allegro.c}
function allegro_init() : integer; asmname 'allegro_init'; external;
begin allegro_init(); Writeln('Hola, esta es una prueba.'); readln; end. ///****************************************//
but the gpc says:
C:\DJGPP\allegro\dzcomm\term>gpc term2.pas --autobuild term2.pas:5: parse error before `)' term2.pas: In main program: term2.pas:8: parse error before `)' term2.pas:8: warning: function call as a statement - value is ignored
What I am doing wrong?, or what switches do I have to set?
Thank you for your help.
Miguel P�rez E Development Engineer Primestone E-Mail: miguel.perez@primestone.com Tel: (571) 6265432 Fax: (571) 6156377