Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VARIABLES VISIBILITY BETWEEN 4GL/EC

Status
Not open for further replies.

alexs97

IS-IT--Management
Apr 27, 2003
5
US
Hello, we've developed some software to communicate different 4GL programs in different machines using TCP/IP. The calling and called programs in 4GL are required to use some EC/C functions so it can communicate via TCP/IP. This functions are group in a file named api.ec. Til now we didn't have problems beacause we compiled the 4GL programs using standard line commands like:

$ c4gl -o calling calling.4gl api.ec

The 4GL programs and the API.ec use some common variables, using the command I just stated we didn't have problems because the command produced one single executable file so the variables in the C and in the 4gl were the same and we can use them as we wanted.

The problem is when this compilation has to pass the precompiled process. Using fglo, zrun, etc. I mean, now my calling program doesn't compile directly to a executable file, instead, to a precompiled file. Now, my functions are not in the same program but callled at runtime. As result of this, the 4gl can't see when I update a variable from ec and viceversa. I know my problem can be figured out making the 4gl and ec code just one ..even when I'm using fglgo, zrun,etc... Does anyone know if this is possible and how to do it????

Alejandro
 
Alejandro:

First, if you are calling "C" functions directly from 4GL you may have a problem when moving to the Rapid Development System, RDS. (I'm assuming you mean RDS because you mention 'fglgo' - the default RDS runner).

I've written "C" functions callable by 4GL. This involves passing variables on the stack - something I don't think you're doing.

The main reason you might have trouble is because c4gl is compiled object code where fglgo is p-code - essentially different environments.

You have to tell the fglgo runner about the "C" object. This is called maked making a custom runner. The process is documented in the Informix documentation, but last year I created this FAQ over in the IBM: Informix Dynamic Server forum:

faq179-2007

that includes this process.

Maybe you could modify this process to fit your needs.

Regards,

Ed
 
Hello olded, we actually have the functions using the RDS environment. We tried to pass teh variables but we have a complez structure to pass. Is there anyway I could pass the hole structure: this is the record and structure definition:

In 4GL :

DEFINE ifx record
idifxprocess integer ,
starttimestamp date,
ifxid integer ,
startprocessid integer ,
ifxretcode integer,
appretcode integer,
dbretcode integer,
dbretmsg char(30)
, v_0010_num_ose float
, v_0010_cod_pto float
, v_0010_int_art float
, v_0010_destino char(80)
, v_0010_ind_pag char(1)
, v_0010_fol_cer float
, v_0010_num_rdd float
, v_0010_num_orp float
, v_0020_cod_pto float
, v_0020_num_ose float
, v_0020_fec_con_orp char(10)
, v_0020_num_rdd float
, v_0010_entero integer
, v_0010_float float
, v_0010_char char(10)
, v_0030_cod_pto float
, v_0030_num_ose float
, v_0030_fol_cer float
, v_0030_ind_con integer
, v_0040_cod_pto float
, v_0040_num_orp float
, v_0040_num_ose float
, v_0040_num_rdd integer
, v_0050_cod_pto float
, v_0050_num_rdd float
, v_0050_fec_con_orp char(10)
, v_0060_num_ose float
, v_0060_cod_pto float
, v_0060_fec_con_orp char(10)
end record

IN EC:

$struct ifx_exec {
long idifxprocess ;
date starttimestamp;
long ifxid ;
long startprocessid;
long ifxretcode;
long appretcode;
long dbretcode;
char dbretmsg[31];
double v_0010_num_ose ;
double v_0010_cod_pto ;
double v_0010_int_art ;
char v_0010_destino[81] ;
char v_0010_ind_pag[2] ;
double v_0010_fol_cer ;
double v_0010_num_rdd ;
double v_0010_num_orp ;
double v_0020_cod_pto ;
double v_0020_num_ose ;
char v_0020_fec_con_orp[11] ;
double v_0020_num_rdd ;
long v_0010_entero ;
double v_0010_float ;
char v_0010_char[11] ;
double v_0030_cod_pto ;
double v_0030_num_ose ;
double v_0030_fol_cer ;
long v_0030_ind_con ;
double v_0040_cod_pto ;
double v_0040_num_orp ;
double v_0040_num_ose ;
long v_0040_num_rdd ;
double v_0050_cod_pto ;
double v_0050_num_rdd ;
char v_0050_fec_con_orp[11] ;
double v_0060_num_ose ;
double v_0060_cod_pto ;
char v_0060_fec_con_orp[11] ;
}ifx;

 
Sorry, but I do not know of any way of passing a record on the stack - only indivdual variables. Informix just doesn't support it.

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top