|
Douglas, I have 4 daughters so I feel your pain. Two got married this year alone... so I'm back working again having gone nearly broke on those weddings!! Yikes! :) EVAL is "copy left-justified" whereas MOVEL is copy left-justified. EVALR is copy right-justified, whereas MOVE is copy right-justified. EVAL does not implicitly convert data types between character/numeric or date fields and non-date fields. You need to use built-in functions for those. EVAL is an assignment statement not a copy statement. This means the target is always replaced with EVAL. EVALR can only be used with non-numeric, non-mathematical expressions. Don't know why, but that's the way it is. EVAL is typically slower than the MOVEL opcode at runtime because IBM often generates temporary variables and does multiple copies depending on what you're doing. For character fields & Data Structures, MOVE and MOVEL effectively utilize a built-in %SUBST function. That is the target (Result field) of a MOVE is only impacted by the number of bytes in the source (Factor 2). If Factor 2 is shorter than the Result, not all of the result is overlaid. If Factor 2 is longer than the Result, all the bytes in the Result are replaced. If you include the P (Pad) operation extender as in MOVEL(P) then any bytes in the Result field beyond the length of Factor 2 are cleared. For Numeric values, the MOVE opcode is converted into a cpynv (copy numeric value) MI instruction (typically) and the data in Factor 1 is copied to the Result field. For a mix of character source and numeric target, the data is converted to numeric and copied. General errors occur when the data doesn't convert correctly. For a mix of numeric source and character target, the data is converted to character and (if MOVE is used) copied to the target right-justified and zero filled. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Douglas W. Palme Sent: Thursday, January 13, 2005 8:28 AM To: RPG programming on the AS400 / iSeries Subject: MOVE vs. EVAL Is there any real difference between the keywords MOVE and EVAL? If so, would someone mind explaining them to me. -- This is the RPG programming on the AS400 / 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-2025 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.