I'm assuming you're asking for the process id of the 4GL program you're executing. Since I don't know of a way to do that with creating a callable "C" function. Here's a solution:
/*
* procid.c: return the current processid
*/
#include <stdio.h>
procid(a)
{
long x;
x=getpid();
retlong(x);
return(1);
}
Here's a test 4GL stub:
# testprocid
main
define x integer,
ret_str char(6)
let x = procid()
display x at 10,10
prompt "Press <enter> to continue: " for char ret_str
end main
If you are using the compiled version of 4GL, it's easy to use:
c4gl testprocid.4gl procid.c -o testprocid
If you are using the Rapid Development System, RDS, you have to link the "C" code into the runtime. Check out my calling "C" functions from 4GL FAQ over in the Informix Dynamic Server forum on how to do the linking:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.