On 5 December 2017 at 18:50, Dan <dan27649@xxxxxxxxx> wrote:
I need to see the block nesting in a large CL source member. I have RDi
v9.5.1.1 and am attempting to use the same named function from the context
menu, but it is giving me "EVFG0102 Matching statement not found." The
source member compiles with no errors other than warnings about
unreferenced variables.
Google is not my friend.
Would really like to see the block nesting in the source editor, but I'll
take a solution that is view only. Ideally, I'd love to be able to
restrict a search within a selected block.
On my 9.5.1, Ctrl-Shift-O seems to show the arrow/outline on the left.
Likewise, Ctrl-M selects a IF...DO...ENDDO block as I expect.
Ctrl-Shift-M to jump back and forth between the beginning and the end.
I've found the support... iffy.
<groan/>
For example. Given this:
IF ((&OPT *EQ 1) *OR +
(&OPT *EQ 2) *OR +
(&OPT *EQ 3) *OR +
(&OPT *EQ 4) *OR +
(&OPT *EQ 8) *OR +
(&OPT *EQ 9) *OR +
(&OPT *EQ 12)) DO
CHKOBJ &SRC2 *LIB
MONMSG CPF0000 EXEC(DO)
SNDPGMMSG MSG('Invalid library. Please supply valid +
library name in SRC or OBJ parameter.') +
TOPGMQ(*SAME)
GOTO TAG001
ENDDO
ENDDO
Put the cursor on the top IF, Ctrl-Shift-O and there are three thin
blue lines. Two of which merge at the final ENDDO. Now I never
reported this behaviour because honestly, I don't know what I want to
see. Do I want to see the match on the DO...ENDDO, the IF...ENDDO?
This is... close enough that I don't think it's PMR fodder. On the
other hand, put the cursor on the top IF of this:
/* If source is *DFT, set up actual library name */
/* Source library */
IF (&SRC *EQ '*DFT') DO
CHGVAR &SRC2 (%SST(&PGM 1 3) *TCAT 'PGM')
/* DFU/QRY */
IF ((&OPT *EQ 1) *OR +
(&OPT *EQ 2)) DO
CHGVAR &SRC2 (%SST(&PGM 1 3) *TCAT 'DFUQRY')
ENDDO
ENDDO
ELSE +
CHGVAR &SRC2 &SRC
and it forgets about the ELSE. Hm.
I figured I'd give regular expressions a whirl, but my first attempt
was a failure. Escape to get to the command line, findText mark
regularExpression (?is)if.*?enddo It only found stuff that had
IF...and ENDDO on the same line (don't judge me lol). I think it was
Matt Tyler who turned me on to using Ctrl-H, then the File tab to
search. Tick the Regular Expression box, then press Ctrl-Space to see
a list of all the regular expression goodies.. Anyway, the regex I
tried above works to find IF...ENDDO that cross lines. ish. There's
always an ish.
Maybe if you could post some example code the list would have a better
go at it that I did.
--buck
As an Amazon Associate we earn from qualifying purchases.