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



That is, if I didn't want the sub to execute anytime *INU1 was set -- 

Francis Lapeyre
IS Dept. Programmer/Analyst
Stewart Enterprises, Inc.
E-mail: flapeyre@xxxxxxxx 


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lapeyre, Francis
Sent: Tuesday, October 17, 2006 3:32 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Commenting out blocks of code in FF

I like Buck's idea. If I didn't want a particular subroutine executed at
any time, I'd just do it like this:

Begsr sub_1;

If *inu1;
  Leavesr;
Endif;

// rest of subroutine here

Endsr;

If I added another call to that SR sometime later, I might forget to
condition it.

Francis Lapeyre
IS Dept. Programmer/Analyst
Stewart Enterprises, Inc.
E-mail: flapeyre@xxxxxxxx 

-----Original Message-----
From: rpg400-l-bounces+flapeyre=stei.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+flapeyre=stei.com@xxxxxxxxxxxx] On Behalf Of
Buck
Sent: Tuesday, October 17, 2006 1:05 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Commenting out blocks of code in FF

Karen: Something we just thought of was: Now, how do you un-comment 
these lines when you want to start using the code again?


By hand.

A different method would have been to insert a different comment, like 
//*.  Then, un-doing it would have been easier.

My preference is the compiler define, but a trick I used years ago was 
to put the block of code in a subroutine and condition the EXSR on an 
external indicator like NU1.  Leave U1 off (i.e. normally) and all the 
code executes as always.  CHGJOB SWS(10000000) then CALL mypgm, and the 
block of code doesn't run.  You can flip it on the fly without 
re-compiling.
   --buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.