× 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.



Ken Sims wrote:
...
Competent programmers pay attention to what they are doing ...

After all, isn't lying to the compiler a way that a program can "mess
with" a procedure? A procedure prototype with EXTPROC can be created
with different parameter types and lengths, with the potential for
decimal data errors, corrupted storage, etc. Shame, shame, shame! <G>


Competent programmers aren't perfect programmers. We can only try to reduce the amount of effort that has to be made by those competent programmers to ensure their changes are correct. If a variable is local, the checking is limited to that procedure; if global, the checking needs to be done for the whole module; if exported from a module in a program, the checking needs to be done for the whole program; if exported from a service program, the checking needs to be done for the whole system.

Creating the kind of additional prototype you suggest is the "work" of an incompetent or even malicious programmer. I don't think it's a natural extension of the special-purpose extra prototype that I suggested.

Anyway, I'm not particularly advocating the double prototype, just offering the technique as an alternative to using a global variable.

Also, you _could_ consider coding a should-be-private variable as a global variable to be lying to the compiler. You are telling the compiler that any procedure is free to use the variable.

This scenario has pointed up a weakness in the RPG language, since it doesn't allow RPG programmers to express the idea that a private static variable should be reset. RPG programmers have to work around this weakness one way or another.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.