• Subject: Re: Omissible vs Optional parms (was How to determine if device is 27x132?)
  • From: bmorris@xxxxxxxxxx
  • Date: Thu, 10 Feb 2000 12:57:10 -0500




>Date: Thu, 10 Feb 2000 01:09:56 -0500
>From: dhandy@isgroup.net (Douglas Handy)
> ...
>I use a prototype like this, where ApiErrorDS is my standard error DS:
>
>     D QryModSup       PR             1    ExtProc( 'QsnQryModSup' )
>     D  DspMode                       1    Const
>     D  Handle                       10I 0 Options( *NoPass )
>     D  ErrorDS                            Options( *NoPass )
>     D                                     Like( ApiErrorDS )
>
>Note that the last two parameters are optional, and you can just
>
>     C                   Eval      Is27x132OK = QryModSup( '4' )
> ...

Doug, those parameters are listed as "omissible", not "optional".
They should have options(*omit), not options(*nopass).  You can
get away with not passing them 999,999 times out of a million, but
on the millionth time a valid pointer will be on the stack where the
API is checking for it, and it will write data to "some" storage,
somewhere.

In general, optional parameters are only used for APIs that are
*PGM calls.  Bound APIs don't normally have any way of detecting
the number of parameters passed.

Barbara Morris


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.