On 4/10/2012 7:00 AM, Phil Smith wrote:
Steve Comstock wrote:
Ah, so that's what you want it for. But if the output buffer
length is zero, doesn't that tell you to use the input buffer?

And if an argument is omitted, it will appear as zero, right?
I mean, why else would you pass a buffer length of zero?

Because users make mistakes? I mean, we could do that, but it doesn't really
solve the problem. We don't want to force them to type OMITTED - at that point
they might as well code:
    rc = THEFUNCTION(inbuffer, inlength, inbuffer, inlength);

What we want is to allow both:
    rc = THEFUNCTION(inbuffer, inlength, outbuffer, outlength);
and
    rc = THEFUNCTION(inbuffer, inlength); /* Works same as if inbuffer/inlength 
specified again as 3rd&  4th parameters */

as we can in COBOL. Or even in C, for that matter. I still find it hard to 
believe that PL/I can't do this!

Remember that LIST seemed like the answer, except that the high bit never got 
set on the last parameter. And then LINKAGE(SYSTEM) seemed like the answer, 
except that you can't specify that on a function call.

...phsiii (will it go 'round in circles...?)

I'm confused here, because the title of the thread
is 'C calling HLASM' and here we are talking about
PL/I.

So what's really going on here that is the mystery?

My guess is: you have a C function that you want to
call from, in this instance, a PL/I program. Right?


Can you show us the definition of the C function
(not the body, just the definition of parameters
along with any pragma statements you might have,
and compiler options relevant to calls / function
references)?


Can you show us how you invoke the function from
C, COBOL, and Assembler? That is, some sample calls
or function references that work successfully, both
with two arguments and four arguments (BTW: do you
allow the output buffer to be specified without the
last length argument? How about no output buffer
but with a length? In other words, must the user
specify exactly two or exactly four arguments?)


Finally: there are some differences in the Enterprise
PL/I compiler regarding compile time options and
options available for declaring functions and
subroutines so I ask this: is your expectation that
your customers will be running the Enterprise PL/I
compiler or some earlier compiler?



--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-355-2752
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

* Try our tool for calculating your Return On Investment
    for training dollars at
  http://www.trainersfriend.com/ROI/roi.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to