Passing a parameter from a C program to an Informix 4gl program
Posted in 1998
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. C program main () { eoj(invno); } Script while test 1=1 do oeinvoice v=$? if $v=0; then break else prndoc.4gl $v fi done 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 () { char command[200]; int invno; command[0] = '\\0'; invno = 0; invno = 21770; sprintf(command,"IDENV01=%s;export IDENV01",invno); system(command); } Any suggestions? We appreciate all advice. Thanks. Aaron