Re: fgl_lastkey and fgl_keyval
Posted in 1993
Phil, If I understand your problem correctly, you have a workaround which will work if you can pass and/or retrieve values between your C function and 4gl program. This is possible, but your solution will vary a little depending on whether you use 4gl compiled or rds. We use compiled, so our code works as follows: 4gl: call exp152 (var_in) returning var_out C: /*********************************************************************** Function: exp152 Parameters: number parameters Input: x a float type variable from informix 4gl Output: result (x to the 1.52) ***********************************************************************/ #include <math.h> exp152 (number) double number; { double x,result; /* pop passed argument off of the stack for use */ popdub (&x); /* Calculate x to the e*/ result = pow(x,1.52); /* put the result on the stack to be returned */ retdub (&result); /* return a single argument */ return (1); } /* exp152 */ This is covered in 4gl Reference Manual - Volume 1 - pp. 2-64 through 2-69. With rds, as I recall there is an additional C routine you need to modify and use along with some additional 4gl code... But I don't really recall since we haven't used rds in quite a while. Good luck! +-------------------------------+----------------------------------------+ | Cathy Kipp | Internet: ckipp@vth1.vth.colostate.edu | | Veterinary Teaching Hospital | | | Colorado State University | Voice: (303) 491-1294 | | Fort Collins, CO 80523 | Fax: (303) 491-1205 | +-------------------------------+----------------------------------------+