× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Maybe I'm just a little naive... but if you can visually see that the
variable being used is an indicator, then it should be second nature to
know that there are only two possible values to be assigned to the
indicator (*ON or *OFF).

Certainly....    var1 = (var2 = var3)  isn't clear at all.

but if you use a named indicator or *IN, then I'd like to believe that it
would be easier to read than a 4-5 line if statement.

An IF statement evaluates your condition to be either true or false.  If
all you are doing is setting an indicator based on that condition, then why
not condense it down to one line of code?

*IN01 = (var2 = var3)


Ciao!
Michael Schutte
Classic Italian dishes with a Bob Evans Twist - Enjoy our new Homestyle
Pastas!


rpg400-l-bounces@xxxxxxxxxxxx wrote on 12/14/2006 08:53:20 AM:

Hi Peter,

Just to "clarify" also, I do consider this construct clear, and
personally find it easier to work with than the long if--then--end
multiple lines:

NamedIndicator = (Value1 = Value2)

...because indicator variables are just like any other variables,
they are values stored at some location in storage. If you can get used
to:

NamedIndicator = (Not NamedIndicator)

then you can get used to the other above expression.

--Alan

+++++++++++++++

-----Original Message-----
Peter.Colpaert@xxxxxxxxx
Alan, I agree that clarity is to be prefered.

Your construct has the additional advantage that you have minimal
maintenance to do if one day you need to cater for Field1 = 'B' etc.

I always view over-complex, un-intuitive statements in programs as (job)
security by obscurity.

Just my opinion of course.

Peter Colpaert

++++++++++++++++++++++

It seems clear to me, I was delighted when I saw Guthrie's pointer on
iseriesnetwork that you could do that. I might avoid it for the next guy,

though, a lot of times I do things for clarity in maintenance.

Like:

select
when Field1 = 'A'
...do this....
when Field1 <> 'A'
...do something else...
endsl

--Alan

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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