Does anyone know if you can call an Informix 4gl function
(ie: a .o object file) from a Micro Focus ESQLCOBOL program? Also,
can you call an Informix 4gl function from a C program?
If either of the above are possible, please provide examples
of compilation and linking instructions.
So long, and thanks for all the fish!
Alison Crichton
: Hello, world!
[1] I don't know about mixing 4GL and ESQL/COBOL. It probably depends on
on the parameter passing conventions used by EQSL/COBOL. See the next
answer.
[2] Yes, it is very easy for C and 4GL functions to call each other. The
conventions for this are well documented in the manuals, tho' the place-
ment varies from version to version. Look for "Calling C functions" or
"Functions, C" in the index of your 4GL manuals.
Because 4GL uses the stack in a particular way, you must make sure that
certain initializations are performed. One way is to use a 4GL main,
which then calls what would be your C main as a function. The other is
to make sure your C main function calls functions fgl_init(argc, argv)
and fgl_sigint(). In some (mostly older) manuals, the use of these two
functions is not well documented.
[3] 42!
Regards,
Alan ___________________________
______________________| R. Alan Popiel |__________________________
\ Internet: | Martin Marietta, SLS | /
\ al...@den.mmc.com | P.O. Box 179, M/S 3810 | Std disclaimers apply. /
)Voice: | Denver, CO 80201-0179 USA | (
/ 303-977-9998 |___________________________| (But you knew that!) \
/________________________) (____________________________\
: Because 4GL uses the stack in a particular way, you must make sure that
: certain initializations are performed. One way is to use a 4GL main,
: which then calls what would be your C main as a function. The other is
: to make sure your C main function calls functions fgl_init(argc, argv)
: and fgl_sigint(). In some (mostly older) manuals, the use of these two
: functions is not well documented.
Alan,
Thank you for your response. I am running Informix 4.11, and
I can't find a reference to the functions fgl_init() and fgl_sigint()
in my reference manual. Could you tell me what version of the reference
manual would have this information?
Alison Crichton
}Alan Popiel (al...@po.den.mmc.com) wrote:
}: Because 4GL uses the stack in a particular way, you must make sure that
}: certain initializations are performed. One way is to use a 4GL main,
}: which then calls what would be your C main as a function. The other is
}: to make sure your C main function calls functions fgl_init(argc, argv)
}: and fgl_sigint(). In some (mostly older) manuals, the use of these two
}: functions is not well documented.
} Thank you for your response. I am running Informix 4.11, and
}I can't find a reference to the functions fgl_init() and fgl_sigint()
}in my reference manual. Could you tell me what version of the reference
}manual would have this information?
I don't think those two functions are documented anywhere.
However, the routines fgl_start() and fgl_call() and fgl_exitfm() and
fgl_end() are documented. In 6.00, they're in Apppendix C of Informix-4GL
Reference: Volume 2. In the 4.1x documentation, they're on page S-210 ff
in the Informix-4GL Supplement. They weren't available in 4.00.
Yours,
Jonathan Leffler (jo...@informix.com) #include <disclaimer.h>
: I don't think those two functions are documented anywhere.
: However, the routines fgl_start() and fgl_call() and fgl_exitfm() and
: fgl_end() are documented. In 6.00, they're in Apppendix C of Informix-4GL
: Reference: Volume 2. In the 4.1x documentation, they're on page S-210 ff
: in the Informix-4GL Supplement. They weren't available in 4.00.
Thank you to all who wrote with the information on calling a
4GL function from a C program. There is a chapter on doing this in
the Informix 4GL supplement, version 4.10, pages S-201 to S-212.
What I really wanted to do was to call a 4GL function from a
Micro Focus ESQLCOBOL program. I have had no luck finding any
documentation to indicate that this is possible. What I will have to
do is have my Cobol program call a C function, which in turn will call
the 4GL functions necessary.
Golly! It's sure fun getting a legacy Cobol application to
play in the same sandbox as a group of 4GL and C applications using an
Informix database.
Alison Crichton - Yes, Michael Crichton and I are related (and _tall_)
- all Crichtons (and probably Creightons) are related, unless their
family took that name, as some former slaves did after the Civil War.
I don't think this entitles me to any money from _Jurassic Park_,
though. :-)