RPG: MOVEA '0000' *IN(51)
Since MOVEA is not acceptable using the 'free' format I tried the
following:
eval *IN(51) = '0000';
but received compile error: "The expression is not valid for
assignment to indicator *IN."
Any help appreciated, thanks.
Hi,
I suggest
Eval *In51 = *Off
Eval *In52 = *Off
Eval *In53 = *Off
Eval *In54 = *Off
offer the advantage to be easily readable and maintainable this way.
IMHO, much more than any other complex op code.
Phil
for i = 51 to 54;
*in(i) = *off;
endfor;
Mel Rothman
Mel Rothman, Inc.
you can try :
1) d DS_In51_54 ds 4 Based(ptr)
2) c ptr = %Addr(*IN(51))
3) c DS_in51_54 = '0000'
eval ScreenInds='0000'
or
eval ScreenInds=*all'0'
But, frankly, I hate mass initializations like this. Obscures what's
going on and makes maintenance more difficult.
> How about
> ** named indicators
> d IndPtr s * inz(%addr(*in)
> d Indicators ds based(IndPtr)
> d ScreenInds 51 54
>
> eval ScreenInds='0000'
> or
> eval ScreenInds=*all'0'
I prefer to be more drastic with naming the "indicators": Between data
structures and renaming on I-specs, it is possible to map the
"indicator" name to something more reasonable, to have that mapping
defined only one place, and to do this without really using the
indicator at all.
>
> But, frankly, I hate mass initializations like this. Obscures what's
> going on and makes maintenance more difficult.
Maybe. Depending on your ability to think of a helpful name for the
aggregated indicators.
HTH,
Terry.
Thank you for the help.