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



I know this is not a problem with RPG III, and in many cases not a problem
with RPG IV. But when I am using ACTGRP(*CALLER) or even named activation
groups, and particularly when I am using linear main procedures files are
not always opened automatically. I know that it is because the Cycle is not
involved, and the easy fix is to include an open block in a program
initialization procedure that looks like this:

if not %open(filename);
open filename;
endif;

This avoids file open problems like trying to access a file that is not
open. But when I have a lot of files, I get tired of writing that same code
block over and over.

The Java editor for eclipse can generate getters and setters. You select
Source -> Generate Getters and Setters from the right click menu, select
the getters and setters you want in the resulting dialog, and click
Generate. The class gets the getters and setters that you just asked for.

LPEX could do that for file opens. Select New -> Generate File Opens,
Select files to generate opens for from the resulting dialog, click
Generate, and the above open block is generated for each of the files you
selected in the dialog. It could be that easy. Snippets get me close, but
are a one at a time thing, and I don't see the outline and the snippet
dialog at the same time since they are tabs in the same view. So I end up
bouncing back and forth. Just extra busy work. So for now I only update
programs that exhibit the error behavior. But that doesn't really fix
things all the way, it's just a band aid.

I submitted an RFE to auto generate file open code as a helper in RDi. You
can find it here.
https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=140322

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.