× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 6/29/2011 6:22 PM, John Yeung wrote:

... my excuses for
avoiding use of prototypes. ...


You don't have to get into modules and service programs to get the benefits of prototypes. You can use prototypes for program calls too.

You do need to put the prototypes into a /copy file, but once you get that set up to have the prototypes copied into the programs and their callers, the cost of doing that extra work to create the prototype for a new program is minor compared to the benefits you get from using prototypes.

Using prototyped calls has little or nothing to do with modularity, and everything to do making it easier to call your programs, and letting the compiler help you get the parameters right.

Compare

D parm1 s type for parm 1
D parm2 s type for parm 2

c eval parm1 = value for parm1
c eval parm2 = value for parm2
c call somepgm
c parm parm1
c parm parm2

to

c callp somepgm (value for parm 1
: value for parm 2)

You only need to define variables for your parameters if the program will modify the parameter. So you save both D specs and C specs when you use a prototyped call.

Instead of *ENTRY PLIST, you /copy the prototype and define the PI in the called program, and the compiler can help you get your parameters matched between the program and its callers.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.