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



Bartell, Aaron L. (TC) wrote:
RPG isn't the only language that has initialize type functions that only
execute the first time they are called.  When I was programming Java
Servlets awhile ago I used a init method to create a pool of iSeries
connections.  I only wanted that to execute when the Java class was first
loaded by Tomcat and the init methods were my ticket.  I am sure there are
many other languages out there with the same thing.  Constructors (in any
language) would also be a comparable to *INZSR. . .

To put it short *INZSR adds functionality to RPG.  If you need it you can
use it, but make just make sure you understand how it works and you will be
set (like Cozzi said).

Maybe *INZSR is the poor mans constructor ;-)


Clearly I wasn't the first one to be reminded of constructors in OO languages. But there are differences. Constructors are used to initialize object instances, a concept which is of course foreign to procedural languages like RPG. Generally, in OO languages, you can't initialize instance data otherwise.


But in RPG, (apart from that weird opcode RESET, which has no comparable analog in any other language, AFAIK) you could just as easily do without the *INZSR. Just perform your initializations when you start your procedure or program, and you're set.

Cheers! Hans



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.