× 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 write 100% of my programs now using MAIN unless I have a CL driver and it
becomes NOMAIN.

I am not clear on what you mean by a main procedure. You do a have a main
procedure. If you are saying you miss writing monolith programs, can't agree
with you there. I hate monolith programs. What a nightmare to maintain.

I have been writing all my new code with nothing but a single function that
received the parameters and called a main function so that when we got V6R1
all I had to do is remove that procedure and add the Main keyword and I have
a cycle-less program.

I have done some timing test and it give me a maybe 10% performance boost.
Programs are smaller. Why have the cycle when we don't ever use it. Should
have had this years ok.

My biggest surprise with Main programs is that is did little to reduce the
size of the static storage. I include the following in every program but
still using a lot of static storage in RPG programs.

h Option(*Srcstmt:*Nodebugio:*NoShowCpy:*NoUnref)

Just wrote a program that has no static variables (expect SQL data
structures which IBM is not smart enough to put local) but still takes 4,848
bytes of static storage. Never have figured out why IBM needs all that
static storage for every RPG program.


On Fri, Nov 5, 2010 at 9:21 AM, Loyd Goodbar <loyd@xxxxxxxxxxxxxx> wrote:

MAIN or NOMAIN? Usually, NOMAIN is used for modules, specially those for
service programs, when cycle process is not needed.

--Loyd

On Fri, Nov 5, 2010 at 8:39 AM, David FOXWELL <David.FOXWELL@xxxxxxxxx
wrote:

Hi,

I've just done my first program using the MAIN keyword. I have to admit
that I didn't see any benefit from doing so. I particularly missed having
a
main procedure with all the global definitions in it. Especially the
program
parameters.

Any thoughts would be welcome.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.