|
The matter of searching has been made much easier in RDi 9 with
hyperlinks - hold down Ctrl and hover over a variable - a hyperlink
appears - click on it and you're at the definition - you'll see the
relationship there.
Alt-Left brings you back where you were.
I love this feature - very quick.
I do agree that the first example makes it look like magic - and magic
is hard to maintain.
OTOH, we're dealing here with things that will never involve
calculations - IDs stored as zoned data types. MOVEL has the advantage
that it's not really a calculation in the sense of an expression, it's a
kind of memory operation, seems to me.
More to think about, eh?
MOV* had so many different uses - overloading, anyone? Hence, the
problems converting it to free-format equivalents.
I've not looked much - is there a place with examples for converting
from MOV* to the several free-format options?
Vern
On 12/9/2013 11:57 AM, Scott Mildenberger wrote:
I think the %div documents the intention better. Reason is that if I go in to look at a program and am looking at the code itself then it isn't obvious that the two fields are related unless you go find there definition in the data structure.
For instance, if you have two lines of code.
Num6 = something();
Somethingelse(num4);
Just looking at that I start wondering where did num4 come from and have to go searching where if you have the following it is easier for me to understand right away.
Num6 = something();
Somethingelse(%div(num6:100));
If you spend a lot of time looking at code just to answer a simple question about what it does in certain circumstances then you may only look at a little bit of the code and it makes it easier to me at least to not have to go looking elsewhere to understand it.
Scott
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Monday, December 09, 2013 10:27 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: Alternatives to MOVEL - just curious
I agree with everything John says, but
I do prefer the DS because I think it
documents the intention better . . .
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Monday, December 09, 2013 10:24 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Alternatives to MOVEL - just curious
What I always do for these is %DIV:
num4 = %div(num6:100);
(Or %rem for the cases where you want a MOVE.)
To me, this is simpler than a data structure because it saves lines of D-specs. However, I don't think anything will perform faster than a data structure, because that requires essentially no (execution) overhead at all, not even a move. In most cases, %DIV is plenty fast enough.
John
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (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 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.