• Subject: RE: RPG - conversion vs re-write -Reply
  • From: "Hans Boldt" <hboldt@xxxxxxxxxxxx>
  • Date: Fri, 12 Sep 97 09:53:12 EDT

David Morris <dmorris@plumcreek.com> wrote:
>Where do you get page numbers?

Ummm, on the bottom corner of the page?  Oh, you must be looking at
the CD-ROM!  (Some of us still prefer books!)

>Even though the code won't compile  Mr. Cozzi's example would be a good
>place to have OPTIONS(*VARTYPE: *VARSIZE), even without full operational
>descriptor support.  It would be nice if *VARSIZE worked for numerics.

As I pointed out in another note, Bob's example won't work for an
even more fundamental reason.  Regarding *VARSIZE working for numerics,
that would be rather problematical.  *VARSIZE for char is straight-
forward in that you can refer only to what is passed using %SUBST.
For numerics, you would have to explicitly handle all possible formats
that you'd want to pass.  Perhaps using VALUE or CONST parameters
would be more appropriate?  After all, there are no format restrictions
on those parameter passing methods.

>Your example works like a boolean value and is just great...but...somewhere
>in the manual (no page numbers in mine) it says that character fields are
>treated as boolean when they are used as the result of a comparison.   Why
>can't the IF make that assumption?  IE:  IF ErrFlg, should work but gives a
>compile error unless coded as IF ErrFlg = *ON.  If it shouldn't work why does
>EVAL ErrFlg = A <> B work?

That's a good question.  First, we decided that for the conditional
statements, the expression must return an indicator value.  The reason
should be clear.  Conditional statements perform one action if the value
of the expression is *ON, and another if the value is *OFF.  If the
expression could return some other value, the action would be undefined.

Now, why can you assign an indicator value to a character field?  Well,
for the same reason that old RPG allows "MOVE *IN01 CHARF".  Indicators
are considered a subset of character data.  And so, they are fully
assignment compatible.

A full indicator data type is coming in a yet to be announced release,
which will allow you to code "IF ErrFlag".

Hans Boldt, ILE RPG Development, IBM Toronto Lab, hboldt@vnet.ibm.com
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].