On 14 Nov 2003 at 14:45, Dr Christian Hicks wrote:
Hi, I am trying to write some examples to demonstrate calling C functions from Pascal. I can call void functions with no parameters, but I am wanting to be able to pass variables. My efforts so far include pcallc.p, ccall.c, ccall.h and Makefile. If function w1 and references to it are removed, it works fine. I am just wanting to learn how to pass variables.
Any help would be gratefully received.
Many thanks, Chris
pcallc.p: [ program pascalcallsC(input,output);
procedure world; external name 'world'; procedure w1(i : integer); external name 'w1';
var i : integer; external name 'i';
Everything is correct except the above line. "i" is not "external", because it is not exported in your C sources. The declaration should simply be: var i : integer;
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Web: http://www.bigfoot.com/~african_chief/