|
From: Jürgen W. <ju...@ya...> - 2005-10-10 14:11:16
|
--- "John R. Culleton" <jo...@we...> wrote:
> A copybook in TinyCOBOL is just an ASCII source file
> placed where the
> compiler can find it. There is no special format.
No, I was speaking about runtime. How can C code
access a copybook?
01 PERSON.
05 NAME PIC X(20) VALUE ' '.
05 AGE PIC 9(04) VALUE 0.
struct person
{
char * name;
int age;
...
}
void fillCopybook(void * copybook)
{
strcpy(copybook,myperson->name);
*(copybook+20) = age;
}
How do I get the structure and offsets of the
copybook?
Is it as simple as all members are behind each other,
or are there any separators or length bytes?
> Interfacing with a compiled C or C++ program can be
> done. The
> documentation for doing this is not available AFAIK.
> In this respect
> OpenCOBOL has better documentation. But there are
> examples in
> the test programs. Look in ../test.code/T07.
Thanks, but there are no C++ examples. But I guess, I
just have to wrap the C code with extern "C".
Jürgen
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
|