|
>>> "Hans Boldt" <hboldt@VNET.IBM.COM> 09/12 7:53 am >>> >>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. Mr. Cozzi's example is illustrative of what we are trying to accomplish. You can easily use a pointer to parse a numeric. You cannot get a pointer to a value or constant. Even without the OPDESC support it would be better than CALLB. >>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". That would be nice. I still think it should work if I can move fielda to *IN01. Thanks for the insight on why things work the way they do. David Morris +--- | 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 +---
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.