using C routines in pascal

Marinier, M. Claude, G. claude.marinier at
Fri Jul 7 14:53:13 CEST 2000


Would it be sufficient to put
	function genbet(x,y:shortreal):shortreal;C;
in the calling program? Is it necessary to have the wrapper unit? If yes,
why is a wrapper needed?


On Fri, 7 Jul 2000, Nathalie Jarosz wrote:
> Actually, I would like to use a fonction named "genbet" in the randlib.c.
> For that, I have made a little program beta.pas:
>      unit beta;
>      interface
>      {$L /usr/local/include/randlib.h}
>      function genbet(x,y:shortreal):shortreal;C;
>      implementation
>      end.
> and test.pas:
>      uses
>          beta;
>      begin
>          writeln(genbet(100,150));
>      end.

Claude Marinier, Information Technology Group    claude.marinier at 
Defence Research Establishment Ottawa (DREO)    (613) 998-4901  FAX 998-2675
3701 Carling Avenue, Ottawa, Ontario  K1A 0Z4

More information about the Gpc mailing list