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



Hans,

I think if MOVE/MOVEL were implemented in the free format stuff, it must
at least work the way it does today, in the following areas:

Character to Character moves
Character to decimal
Decimal to character
Date to char/dec
Dec/Char to date

Is that everything? Probably not.
Again if you just implement a:
CharToDec
DecToChar
CharToHex
HexToChar

Set of built-in functions, most of the MOVE issues would be one. I have
stopped using MOVEA years ago, and I rarely use MOVE/MOVEL anymore
(although I do NOT frown on their use).

As to the semi-colon; come on! What there are 12 programs out there that
use free form and the entire universe has to use a semi-colon at the end
of the IF statement because of them? Screw those 12 programs <g>. It
just gives us a challenge. We would need to build a tool that analyzed
the source and noted it (hence, implementing a semi-colon free IF
statement would have to occur in V5R2), OR you could write a
syntax/grammar that ignored the semi colon at the end of the
IF/ELSE/ENDIF statements. Why not just eat it? Hmmm????

  If   a = b;
    Move X to Y;
  Endif;

  If A = B
    Move X to Y;
  Endif


  If A = b;  Move X to Y; endif

  If (A = b)  Move X to Y; endif


It could work.

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 boldt@ca.ibm.com
> Sent: Wednesday, February 27, 2002 12:51 PM
> To: rpg400-l@midrange.com
> Subject: RE: MOVE opcode in freeform (was Strange behavior w/%editc)
>
> Bob wrote:
> >I'm always interested in making RPG be a better language. All areas
need
> >to be improved, not just those that I use. And you're right, I have
yet
> >to use a single line of /FREE stuff in my code, (experimental or
> >otherwise). The only /FREE stuff I've written has been in email
clients
> >sending messages to this group. Why? Because the syntax isn't good
> >enough for me to use it yet.
> >
> >What would they have to do to fix that?
> >
> >Get rid of the /FREE - /End-FREE requirement. A blank in column 6
should
> >indicate a non-traditional calc spec.
>
> This one is possible, we think.
>
>
> >Remove the semi colon requirement from the end of conditional
statements
> >IF/ELSE/ENDIF/DO etc.
>
> Won't happen, since there's apparently a bit of /free code
> already out there.  We would have to introduce some syntax
> to indicate statement continuation (such as Python's \),
> which would cause existing code to not compile.
>
> Besides, we'd then be back to that "more than one way to
> do it" syndrome that you seem to dislike so much!
>
>
> >Add a "Move corresponding" operation code to the language (<g> just a
> >COBOL pun).
>
> That's on our "proposed enhancements" list.
>
>
> >Include the MOVE and MOVEL operation codes as they work today. There
is
> >not technical reason that I've heard, as to why MOVE and MOVEL were
left
> >out. I use EVAL mostly today in my traditional-syntax RPG IV. But I
> >don't want to nest %subst() and other built-in functions just to make
an
> >EVAL simulate what a MOVEL does.
> >Take a look at this example from CodeStudio's "Modernize" feature:
> >
> >Original Code:
> >
> >     C                   MOVEL     src           target
> >
> >Modernized Code:
> >
> >     C                   Eval      %SUBST(target:1:%len(src)) = src
> >
> >Is that more clear? Well, it might be to a non-RPG programmer. But so
> >what? Let those who worry about non-RPG programmers maintaining their
> >code, use EVAL. Let use RPG programmers use MOVE/MOVEL.
>
> This raises an interesting question.  When you read a
> program in some language, and you see a value assigned to
> a variable, do you expect that the entire variable is
> changed?  Or do you expect that just the right-most (or
> left-most) bytes get changed?
>
> Yes, to properly convert MOVE/MOVEL to EVAL, you need to
> do some funny gymnastics to duplicate the exact semantics
> of the MOVE.  But which operation is more common:  Full
> replacement of the value in the target variable?  Or just
> changing right-most (or left-most) bytes?
>
> The semantics of numeric MOVE's is even more convoluted
> in the general case, and is hardly worth preserving a
> convenient syntax for.
>
> Cheers!  Hans
>
> Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
>
> _______________________________________________
> 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.