Commenting out a block of code? You could use the @rdocc function I
showed yesterday in RPG-L list.
http://archive.midrange.com/rpg400-l/200907/msg00366.html
I throw it out here since it may be useful to someone with a similar
need sometime.
I put a sample of my @rdocj and @docc in the other list yesterday. I
realized that it could be used in this case, too. To summarize, I have
@rdocj() which puts comments out to the joblog using QMHSNDPM.
It's sister function is only a "commenter", nothing to the joblog, but
is useful if you want to define a block of code as being grouped
together using an If or Dou for an indent, without moving the bypassed
code into a separate subroutine or subprocedure.
I see a disadvantage using /IF and /ENDIF .... These complier commands
do not like comments after their /IF DEFINED( SKIP )
And if there are any "C" Calc lines with fields defined inside the
block, those fields have to be defined elsewhere.
Creating an "If" to get around the code block is a suitable substitute.
Especially when debugging in development.
And I can build a self-documenting If using my @rdocc() function. (Not
efficient in the machine as /IF, but . . .
The @rdocc allows 4 lines of text and always returns True. It attaches
that literal-text to the structure of the code-block being bypassed. So
the @rdocc function is for documenting/commenting anything really
important - like program flow changes that might be temporary.
You separate the code block by using Dou or If using @rdocc() knowing
that @rdocc always returns True.
So instead of
/IF DEFINED( SKIP )
You could have
If not @rdocc('We are commenting out this section' :
'just for now, because the business will not be providing discounts'
:
'for the next 3 months' : ' per request # OE 12345' ) ;
It is just another way to stop a block of code from running.
And it is more elegant than If 1<>1 .... Where you ask yourself, did
someone make a typo here?
As an Amazon Associate we earn from qualifying purchases.