4GL question
Posted in 2005
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
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? count = 1 nxt_business_day = theDate TIA, Bill sending to informix-list
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. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/