I have a PL/I subroutine call that has 297 optional parameters.  That is the 
function has a parameter list with up to 100 tuples of parameters.  The first 
tuple is required, and tuple 2 through 100 are optional.

In C the function signature looks like this

int myFunc( int *numDescriptorEntries,
                   int *numBufferEntries,
                   char *errorBuffer,
                   char *descriptor,
                   char *Buffer,
                   int  *Length,
                   ...);

In PL/I I'd like to do this

   Declare myFunc External('VSHPARR') Entry(
           Fixed Bin(31) byaddr,                 /* Number of Descriptors */
           Fixed Bin(31) byaddr,                /* Number of Entries */
           Char(*) byaddr,                       /* Error msg buffer */
           Char (*) byaddr,                               /* descriptor*/
           Char (*) byaddr,                          /*Buffer */
           Fixed Bin(31) byaddr,                  /*  Length */
            * optional,
           )
           returns( byvalue Fixed Bin(31) )           /* Return code */
           options ( nodescriptor, linkage(system) );


But PL/I flags this call as an error because I need all three "*optional" 
declarations

   rc = myFunc (numDescriptorEntries,
                numBufferEntries,
                error,
                Descriptor1,
                Buffer1,
                Length1,
                Descriptor2,
                Buffer2,
                Length2);

Which means I have to declare this

   Declare myFunc External('VSHPARR') Entry(
           Fixed Bin(31) byaddr,                 /* Number of Descriptors */
           Fixed Bin(31) byaddr,                /* Number of Entries */
           Char(*) byaddr,                       /* Error msg buffer */
           Char (*) byaddr,                               /* descriptor*/
           Char (*) byaddr,                          /*Buffer */
           Fixed Bin(31) byaddr,                  /*  Length */
            * optional,
            * optional,
            * optional
           )
           returns( byvalue Fixed Bin(31) )           /* Return code */
           options ( nodescriptor, linkage(system) );

So for 100 repeats of the tuple, this function declaration is going to get 
quite lengthy with loads of "* optional" parameters.
Is there a shorter way of declaring 297 optional parameters in PL/I?

Thank you!
Janet

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

Reply via email to