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



You can overlay array elements.  Even if you do a bunch of EVAL's, it's
still less code...

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
Behalf Of Wills, Mike N. (TC)
Sent: Monday, March 04, 2002 5:08 PM
To: 'rpg400-l@midrange.com'
Subject: RE: Divide by zero monitoring

They are in arrays... however since there is no easy way to print the array
contents to an externally described printer file, I am forced to have one
line of logic for each field to print. I would not have bothered asking the
question if I had it in a loop.

Unless you are talking about something else....


-----Original Message-----
From: Reeve Fritchman [mailto:reeve@ltl400.com]

Bob has a point.  Mike, if you can put everything into a couple of arrays,
you can eliminate the redundant coding of checking for a zero divisor.  Loop
through all the elements and check element by element...

-----Original Message-----
Behalf Of Bob Cozzi (RPGIV)

Let's not forget, that there is overhead involved in calling a
procedure!
I ran a test using the XLATE operation in my TOUPPER()
procedure/function. It took 26 times longer to run the code in a
procedure than it did as in-line code. Now, that's a couple lines of
code vs a procedure wrapper for that same few lines of code.  Of course
if you put 100 lines of code into a procedure, the overhead isn't going
to increase, it'll stay the same.

Until IBM adds a "Inline" keyword to procedures, use of procedures for
certain time-critical things (like math) might be better left on the
wish list.


Specs:

Called the procedure 30000 times
vs.
Inline XLATE and SUBST opcodes.

Procedure was approximately 14.17 units of measure.
Inline code was 0.02 units of measure.

So the overhead for a procedure call is X where X = approx. 13.8 units
of measure regardless of the size of the procedure.

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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 ...

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.