Cool trick! Probably a bit(!) confusing to application developers who really don't understand how program linkage works, but definitely cool.
----- Original Message ----- > From: Steve Comstock <[email protected]> > To: [email protected] > Cc: > Sent: Tuesday, April 10, 2012 8:15 PM > Subject: Re: PL/I with variable PLISTs (was: LE C calling HLASM) > > On 4/10/2012 4:33 PM, Frank Swarbrick wrote: >> ----- Original Message ----- >>> From: Phil Smith<[email protected]> >>> To: [email protected] >>> Cc: >>> Sent: Tuesday, April 10, 2012 3:31 PM >>> Subject: Re: PL/I with variable PLISTs (was: LE C calling HLASM) >>> >>> Bernd Oppolzer wrote: >>>> I don't know if it helps you, but using C I would code the two > calls >>> this way: >>> >>>> rc = THEFUNCTION (&magic, inputbuffer,&inputlength, NULL, > NULL); >>> >>> Exactly backwards-the idea here is to NOT be obscure, but to have a > nice, >>> flexible, intuitive API. Having to specify null parameters or to use a > macro for >>> things is what we *don't* want to do. >> >> Haha, I can agree with that! >> >> Funny thing with Enterprise COBOL... It "properly" sets the > high-order bit >> on > the last parm, but supplies no way to interrogate it! So if > "THEFUNCTION" was >> written in COBOL then you have to invoke it thusly: >> >> CALL 'THEFUNCTION' USING MAGIC, INPUT-BUFFER, INPUT-LENGTH, > OMITTED, OMITTED >> RETURNING RC. >> >> (The OMITTED keyword simply passes an address of NULL.) >> >> Oy! > > Well, there is a little trick you use, involving defining the > trailing parameters as pointers coming in by value, on the > procedure division header name the pointers not the items, > defining items you expect in linkage, redefining a binary > item on top of the pointers, to access one of the data items > use 'set addres of data_item to pointer', when you're done > with an item check if the redefined (binary version) is > negative - that indicates the end of list bit is on. > > No problem. > > :-) > > >> >> Frank >> >> ---------------------------------------------------------------------- >> For IBM-MAIN subscribe / signoff / archive access instructions, >> send email to [email protected] with the message: INFO IBM-MAIN >> > > > -- > > 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 > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

