|
Joe, MOVEL doesn't work on VARYING fields, hence I wouldn't even think about using MOVE on them (while it might indeed still work). In my (and IBMs) opinion, MOVE(L) instructions shouldn't be used in ILE-RPG anymore, hence I banned them already longtime ago. If the discussion is/was about legacy code using MOVE operations... then there isn't much to say, except that I would recommend to convert it to EVALs (whether or not they're a valid replacement - the same can be said about native IO and SQL as well, hence people migrated anyway). I guess we have been saved from huge code rewrites since RPGIII existed, while on other platforms huge code rewrites seems to be a yearly task (just think about the differences between each VB version). Somehow, managers seem to find this acceptable (even starting from scratch) when one of the magic M$ words is mentioned in the sentence. When we discuss this about iSeries software, it shouldn't cost a cent !? What's wrong with implicit type conversions ?... they decrease readability since they do things that isn't visible straight away (at least in a "complex" %SUBST instruction you see that something is done). The C style casting is in that way much clearer. Discussions about languages is something I normally also try to avoid, however we iSeries people seem to be the only ones that realize that RPG has its strengths, and should be used as a business language and not some other hyped language. Kind regards, Paul -----Original Message----- From: Joe Pluta [mailto:joepluta@PlutaBrothers.com] Sent: 06 March, 2002 15:08 To: rpg400-l@midrange.com Subject: RE: Strange behavior w/%editc() > From: Nicolay, Paul > > I guess both the MOVE (which won't even work if you're using VARYING > strings) and %SUBST solution should be avoided as they're neither clear. Maybe I misread the posts on MOVE and varying strings. From what I understood, the MOVE works exactly the same, moving data into the last positions of the varying string. Have you found otherwise? > The best solution as far as I'm concerned is the use of datastructures to > split the field, and fill it with the EVAL statement. It doesn't > depend on > implicit type conversions like you get when using MOVE. What's wrong with implicit type conversions? > In addition, the MOVE and %SUBST shouldn't be compared neither since the > MOVE always targets the last six characters, where the %SUBST > uses a dynamic > solution (also using fixed start and length positions could make it a lot > easier to read, and maybe even preferred above the DS solution). My original point way back when was that the MOVE instruction didn't have a reasonable replacement in the new /free syntax. Others have tried to insist that the %subst replacement is equivalent. I've simply opined that it is not, and shown what I base my opinion on. If you are using data structures, then great, your code can quickly be converted to EVAL statements and there are no issues with /free. But if your code uses MOVE instructions, there's no good substitution. I guess I can agree, at a 30,000 foot level, that data structures are better, but that argument doesn't do me a lot of good if my legacy code uses MOVE instructions. > Anyway... speed shouldn't be the main factor (it is a key factor > however) in > software design. Otherwise we would better return to coding in > assembler/MI... and never start with VB or Java ! There's a balance between performance, delivery and maintenance. Different languages have different strengths. Java is an OOP language, and as such is highly suited for developing sophisticated middleware where components inherit behavior from one another. RPG is best suited for coding business algorithms, and should be focused on making tht as easy as possbile. VB has its place, I suppose, but not for anything I do. But THAT dicussion is very much one of opinion. Joe _______________________________________________ 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 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.