RE: 4GL question
Posted in 2005
> -----Original Message----- > From: owner-informix-list@iiug.org [SMTP:owner-informix-list@iiug.org] > On Behalf Of Jonathan Leffler > Sent: Friday, May 27, 2005 4:22 AM > To: informix-list@iiug.org > Subject: Re: 4GL question > > Bill Dare wrote: > > I have a question regarding values returned by a C function called > from > > a 4GL program. The following is from the 4GL Reference Manual: > > > > mint nxt_bus_day(mint nargs); > > . > > . > > . > > ibm_lib4gl_returnDate(theDate); /* stack result */ > > return(1) /* return count of stacked */ > > > > If I call this function as: > > > > LET count = CALL nxt_bus_day(currentDate) RETURNING nxt_business_day > > > > Would I expect the following results? > > I would expect to get syntax error. > > If nxt_bus_day() returned two values - it doesn't - then you could > write: > > CALL nxt_bus_day(currentDate) RETURNING nxt_business_day, count > > Or, given that it actually returns 1 value (the return(1) says there > is > one value on the 4GL stack returned to the caller) you could write: > > LET nxt_business_day = nxt_bus_day(currentDate) > > The hybrid should be a syntax error - it should not compile. [Bill Dare] It did not compile, as you said. I'm not a 4GL programmer, just trying to clean up several sloppy C functions called from 4GL and I wanted to get a good understanding of how data is passed between 4GL and C. Thanks, Bill > -- > Jonathan Leffler #include <disclaimer.h> > Email: jleffler@earthlink.net, jleffler@us.ibm.com > Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/ sending to informix-list