Re: Passing a parameter from a C program to an Informix 4gl program
Posted in 1998
Mike Segel wrote: > > Aaron Gatzke wrote: > > > > Problem: We are trying to pass a parameter, such as an invoice > > number, from a C program to a 4gl program. The variable > > is of datatype INTEGER. > > > > Info: We have an existing front end application written > > in C but are adding new modules written in Informix 4gl. > > We are running HPUX and use the korn shell. > > > > We have tried two methods: > > 1. Pass a parameter through a C function to a Unix script. > > Our problem is that the eoj() function can only accept values > > up to 255. Also, we are not C programmers and don't know > > enough to create our own function or how to extend the > > functionality of the existing function. > [SNIP] > > > > 2. Try to set an environment variable that GETENV can access. > > The problem is that the environment variable doesn't exist > > after the C program quits. > > C program main () > [SNIP] > > Any suggestions? We appreciate all advice. > > Thanks. > > > > Aaron > > Uhmm, if the 4GL module doesn't have to be a separate program, you can > use 4GL modules > mixed with C code. (RTFM) > > Or you can write the data to a flat file, and have the second program > read the flat file. > You have to remember if you write the variable to the environment shell, > you are > writing them to a new shell. Once your C code ends, the shell is gone. > and the parent > shell which executes your shell doesn't have the variables. > > -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 resembalence to a coherent rational thought is purely coincidence. > -The Management. > #endif > ***************************** > * Attention * > -*- Due to AGIS's Refusal to Act Responsibly > -*- Due to ACSI's Refusal to Act Responsibly > > We are blocking all of their domains at the packet level. > This block will exist until they modify their policies to > conform to existing RFCs and net community standards. > > We encourage all ISPs and domain holders to do the same. > ***************************** You could use a pipe instead of the flat file. If there's a lot of data to pass, maybe you need the C to write a file in UNLOAD format, which you then LOAD and access from 4GL. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 Mail: Peter.Lancashire.PL1@bayer.co.uk --- My Internet plumbing does not allow me to mail and post news together. Sorry. All opinions are my own and not those of Bayer plc. --- Join Infuse, the UK Informix User Group at http://www.infuse.co.uk/