gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Library "super" procedure.


From: Patrick
Subject: Re: [open-cobol-list] Library "super" procedure.
Date: Fri, 10 May 2013 23:36:25 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

Hi Again

I have been reading more and have found multiple problems with my own proposal. Sorry for the noise.

It looks like COMMON is for nested programs and not separate ones, not a big deal in itself, I could COPY the library code in. However it does not appear to allow one procedure to call paragraphs in the other. IS EXTERNAL seems to allow this for data but I don't think this is for procedure code.

Back to the drawing board.

Sorry again for cluttering your in-boxes....



On 13-05-10 06:06 PM, Patrick wrote:
Hi Brian, thanks for answering my post yesterday :)


Hi Everyone, I have another question or rather a request for feedback.

I am trying to use Cobol well outside of it's stronghold, as a business
applications language.

I will need to work with a lot of C libraries and write my own wrappers..

I also want to organize my own Cobol code in the best way I can.

I really appreciate all the feedback from the "organizing code in Cobol"
thread and all the other threads I started too.

I just want to expand a on things a bit.

So let's say I wanted to wrap Berkeley sockets, Termios(serial ports),
libcurl or maybe sqlite etc.

At first I was thinking that I could wrap each CALL to a C function in a
paragraph statement and then copy it into the program and define the
arguments in working storage or possibly copy in a working storage
section that had arguments laid out already.

so pseudo code....

WORKING-STORAGE DIVISION.
01 foo-arg.
     05 someString PIC X(20).
     05 someNumber PIC 9(3).

PROCEDURE DIVISION.
COPY "foo"
MOVE "BLAH" TO someString
MOVE "123" TO someNumber
PERFORM fooSomething....

etc......



This is okay but it would be nice to have all the C arguments laid out
ahead of time and then I could just MOVE values to them.

I could use two copy calls but what about a "super program" that used
the COMMON keyword instead:


IDENTIFICATION DIVISION .
PROGRAM-ID. foo IS COMMON PROGRAM.


If I defined all the argument variables and wrapped all the CALLS to C
functions in paragraphs, would each paragraph and each variable be
available to all programs linked in the same executable?

Does this seem like a sensible way to layout a binding?

I was thinking that I could also wrap CALLS to my own nested programs in
paragraph statements and use them through the "super" procedure as well.
I was thinking that I might be able to code things in such a way as to
make some data and procedures private and some public this way.

Thanks for reading, any feedback is appreciated-Patrick




------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list




reply via email to

[Prev in Thread] Current Thread [Next in Thread]