The code I saw almost exactly like that years ago when I first started programming took it one step further because the array was named "A".
It took me days to finally see what it meant in the output when it looked like this:
O A 80
As always, if there are any questions, please let me know.
Thanks,
Dave Boettcher
e-mail: dave.boettcher@xxxxxxxxxxxxxxxxx
Voice: 262.653.2520
If you really want to do something, you'll find a way; if you don't, you'll find an excuse.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Wednesday, August 24, 2016 8:40 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: RPG passing parms to and from Rexx
On 24 August 2016 at 17:42, John Yeung <gallium.arsenide@xxxxxxxxx> wrote:
On Wed, Aug 24, 2016 at 4:45 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
I should have probably commented that. The reason I used all
variables instead of constants or literals is that I wanted the
example to clearly show that the logic could dynamically decide what 'function' to perform.
I appreciate your efforts to be illustrative, but I would think that
should already be abundantly clear by the fact that it's a
*parameter*, no?
Decades ago, there was a 'Teach yourself RPG' course; I can't remember the company. They had an example of a compile time array that traumatised me. They put the headings for a printed report in the array. So the O-Specs were like
OQSYSPRT H 203 1P
O OR OF
O UDATE Y 10
O ARR,1 90
...
The reason this traumatised me isn't the example per se. It's the fact that dozens; perhaps hundreds of RPG programmers took that example as a way to do O-specs. I have personally witnessed this pattern in thousands of programs, in multiple companies.
We've all of us seen how programmers tend to copy examples verbatim and try to use them without first studying them to obtain understanding. The threads on POI, Java, and Excel demonstrate the problem.
I've now become too cautious with my examples because of this. Which is why the subject line reads as it does. I'm not proposing a
wonderful way to make a BIF. I'm showing one way RPG and Rexx can
interact. And hoping that launches a few ideas.
--buck
As an Amazon Associate we earn from qualifying purchases.