Five lines of code are displayed before the MSGLINE except when there are fewer than five lines between two MSGLINEs.
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT SEEK P'=' 1 NEXT"
"ISREDIT LOCATE NEXT MSGLINE"
IF RC=4 THEN DO
'ISPEXEC SETMSG MSG(MONER008)'
EXIT
END
"ISREDIT SEEK P'=' 1 NEXT"
"ISREDIT DOWN CURSOR"
"ISREDIT (LT) = LINENUM .ZCSR"
"ISREDIT LOCATE NEXT MSGLINE"
IF RC=4 THEN DO
'ISPEXEC SETMSG MSG(MONER008)'
LN = LT-5
"ISREDIT LOCATE &LN"
END
ELSE DO
"ISREDIT (LN) = LINENUM .ZCSR"
LN = LN-5
DO WHILE LN<LT
LN = LN+1
END
"ISREDIT LOCATE &LN"
END
"ISREDIT SEEK P'=' 1 NEXT"
"ISREDIT LOCATE NEXT MSGLINE"
IF RC=4 THEN DO
'ISPEXEC SETMSG MSG(MONER008)'
EXIT
END
"ISREDIT SEEK P'=' 1 NEXT"
"ISREDIT DOWN CURSOR"
"ISREDIT (LT) = LINENUM .ZCSR"
"ISREDIT LOCATE NEXT MSGLINE"
IF RC=4 THEN DO
'ISPEXEC SETMSG MSG(MONER008)'
LN = LT-5
"ISREDIT LOCATE &LN"
END
ELSE DO
"ISREDIT (LN) = LINENUM .ZCSR"
LN = LN-5
DO WHILE LN<LT
LN = LN+1
END
"ISREDIT LOCATE &LN"
END
Thanks again Steve.