|
Jim, MOVEL does work with VARYING length fields. When using MOVEL with VARYING length fields, the VARYING field's length does not change. That is the VARYING length field's current length is used, and hence the VARYING length field is treated as a fixed length field whose length is the current VARYING field's length. So a MOVEL of "BBB" to a VARYING length field whose current length is 5, will replace the first 3 characters of the field. But a move of "CCCCCCCCCC" to that same VARYING length field, would copy of "C" characters to the field and the length would be unchanged. Bob Cozzi cozzi@rpgiv.com Visit the on-line Midrange Developer forum at: http://www.rpgiv.com > -----Original Message----- > From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com] On > Behalf Of Jim Langston > Sent: Tuesday, February 26, 2002 8:38 PM > To: 'rpg400-l@midrange.com' > Subject: RE: Strange behavior w/%editc() > > Well, MOVE(L) does a lot of things. > > But what would happen when you MOVE a 5 character field into a varying > string? Does it make a difference if the Varying string already contains 10 > characters? Should it replace the first 5 characters and leave the last 5 > alone? Or should it make the string 5 characters long? And if you wanted > it to just replace the first 5 characters, what would you want it to do if > the varying string contained only 3 characters? Should it make the string 5 > character? Or should it just replace the 3 characters? > > I believe the reason Move wasn't ported to freeformat is because of these > types of questions. MOVE doesn't work well, IMO, on varying strings > because, so far, it hasn't had to. > > I really don't know what would happen if I tried to do a MOVE into a varying > length string, but I'm sure it wouldnt' be the way I wanted it to. > > Regards, > > Jim Langston > _______________________________________________ > 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.