7-Jul-00 08:53 you wrote:
Hi,
Would it be sufficient to put function genbet(x,y:shortreal):shortreal;C; in the calling program?
Yes.
Is it necessary to have the wrapper unit?
No.
If yes, why is a wrapper needed?
Why units are needed at all ? Why .h file are used in C programming ? To have ONE definition of function, of course. So you do not need to change 10'000 files when genbet definition will be changed...
Thanks.
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@dreo.dnd.ca Defence Research Establishment Ottawa (DREO) (613) 998-4901 FAX 998-2675 3701 Carling Avenue, Ottawa, Ontario K1A 0Z4 http://www.dreo.dnd.ca