Re: HELP! C routines & 4gl
Posted in 1997
acvis@cam.org wrote: > > Does anyone know of a clever, efficient way of returning multiple rows > from a C routine to a calling 4gl program? We need to send one set of > arguments from the 4gl program to the C routine. The C routine may send > back from 0 to several rows of data. Any suggestions? Well, since you can't push back the pointer to your data, try the following: (Assuming that the following occurs: 1) You know how many rows you want to return at the time you are returning. 2) you are not returning too many rows or the rows are not too big. 3) you know what the data set will contain. (You can get around this too ) ) Push the data on to the stack in reverse column order. (You want A B C so push C B A) Then at the end push the number of rows (LONG) on the stack. Pop the number of returned rows, and enter a for loop poping data off. In my drug induced foggy memory, I believe that if you do not clear the stack of data, you may run in to problems. HTH -Mikey -- #include <std_disclaimer.h> /* Mike Segel (MS385) */ #include <No_Spam.h> #ifdef OFFENDED_BY_CONTENT The author takes no responsibility for this post. Any resemblence to a coherent rational thought is purely coincidence. -The Management. #endif ***************************** Due to AGIS's Refusal to Act Responsibly We are blocking all of their domains at the packet level. This block will exist until AGIS modifies their policies to conform to existing RFCs and net community standards. We encourage all ISPs and domain holders to do the same. *****************************