Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MOVEA using ILE free format

971 views
Skip to first unread message

Rob M

unread,
Jan 3, 2003, 10:20:14 AM1/3/03
to
I am in the process of converting an ILE program to the 'free' format
and have hit a bump in the road. How do I convert the following line
of code?

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.

Phil

unread,
Jan 3, 2003, 11:24:54 AM1/3/03
to

"Rob M" <r72...@earthlink.net> a écrit dans le message de news: 7c5544da.03010...@posting.google.com...

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

Mel Rothman

unread,
Jan 3, 2003, 12:44:33 PM1/3/03
to
It can done in a loop. Assuming i is defined as a two- or 4-byte integer:

for i = 51 to 54;
*in(i) = *off;
endfor;

Mel Rothman
Mel Rothman, Inc.

BTM

unread,
Jan 3, 2003, 1:44:52 PM1/3/03
to

Rob M <r72...@earthlink.net> a écrit dans le message :
7c5544da.03010...@posting.google.com...


you can try :

1) d DS_In51_54 ds 4 Based(ptr)

2) c ptr = %Addr(*IN(51))
3) c DS_in51_54 = '0000'


Drew Dekreon

unread,
Jan 6, 2003, 2:08:05 PM1/6/03
to
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'

But, frankly, I hate mass initializations like this. Obscures what's
going on and makes maintenance more difficult.

Terrence Enger

unread,
Jan 6, 2003, 8:03:23 PM1/6/03
to
Drew Dekreon wrote:

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

Rob M

unread,
Jan 7, 2003, 4:05:12 PM1/7/03
to
Terrence Enger <ten...@idirect.com> wrote in message news:<3E1A275B...@idirect.com>...

Thank you for the help.

0 new messages