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



-----Message d'origine-----
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Colpaert, Peter

If you comment out the first condition, it will fail because
of the AND on the second line.

I would put every condition or operator on its own line:

If (
Condition1
And
Condition2
);

Well spotted thanks

-----Message d'origine-----
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Terrence Enger
If you introduce a tautology, you can handle condition_1 the
same way as later conditions

if ( 1=1
and condition_1
and condition_2
);

I thought of that afterwards but didn't dare suggest it.
if ( 1=1
and MyVar = MYCONSTANT
);

would not go down very well!

-----Message d'origine-----
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Charles Wilt

Consider moving the tests into a procedure?

if SomeBusinessCondition(fld1:fld2)

endif;

You code is much more self-documenting and thus maintainable this way.
Plus you can easily reuse the logic by moving the procedure
into a service program.

This I like best. Although I'd need to have the code in a procedure from the beginning as I rarely see code moved, it just ends up getting copied. You are lucky to have the liberty to code that way. If I wanted to move :

If (
myDogsColor <> gBLACK and
myDogsColor <> gWHITE
);

I'd like to code
If IsColored ( MyDog )

But I'd probably end up with
IF NOT AcqDogClrFl ( MyDog : error ) // AcqDogClrFl = acquire dog is colored flag !

And then I'd get slapped for all those extra lines of code ( prototype, interface, beginning, end)

sigh...







As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.