/* REXX ------------------------------------------------------------- */ /* Macro: LINFO (Line INFO) */ /* Syntax (1): LINFO zn */ /* (2) LINFO zn1 zn2 | LINFO ALL */ /* Paramater: zn, zn1, zn2 = linenumber / Label */ /* Function (1): shows status information about one line */ /* (2): shows status information about some lines */ /* Author: Norbert Haas */ /* Examples: - LINFO 12 */ /* - LINFO .X */ /* - LINFO .zf .zl */ /* - LINFO ALL */ /* */ /* Version Autor Datum Anlass */ /* ------- ------------- ---------- --------------------------------- */ /* V02.01 N.Haas 30.05.2003 english version */ /* V02.00 N.Haas 19.11.2002 auch zwei Zeilen, Bereich */ /* V01.00 N.Haas 15.11.2002 Erstellung */ /* ------------------------------------------------------------------ */ /* receive linenumer(s) */ "ISREDIT MACRO (fromline,toline,dummy) NOPROCESS" /* dummy must not exist */ IF dummy /= "" THEN DO zedsmsg = 'PARAMETER WRONG' zedlmsg = 'MACRO LINFO DOES NOT NEED MORE THAN TWO PARMS.' "ISPEXEC SETMSG MSG(ISRZ001)" EXIT 12 END /* ALL ? */ IF TRANSLATE(fromline) = 'ALL' THEN DO fromline = '.ZF' toline = '.ZL' END /* fromline must exist an be numeric or existing label */ IF fromline = "" THEN DO zedsmsg = 'PARAMETER MISSING' zedlmsg = 'MACRO LINFO NEEDS TWO LINENUMBERS/LABELS TO', 'WORK WITH.' "ISPEXEC SETMSG MSG(ISRZ001)" EXIT 12 END lfromline = TRANSLATE(fromline) /* linenumer ist number or label ? */ IF DATATYPE(fromline) = 'NUM' THEN DO /* number ? */ "ISREDIT (last) = LINENUM .ZL" IF fromline > last THEN fromline = last IF fromline < 1 THEN fromline = 1 END ELSE DO /* label ? */ "ISREDIT (fromline) = LINENUM (fromline)" IF fromline = 0 THEN DO zedsmsg = 'LABEL NOT FOUND' zedlmsg = 'THE LABEL YOU ENTERED ('lfromline') DOES', 'NOT EXIST.' "ISPEXEC SETMSG MSG(ISRZ001)" EXIT 12 END END /* secound parm ? */ IF toline /= "" THEN DO ltoline = TRANSLATE(toline) IF DATATYPE(toline) = 'NUM' THEN DO /* number ? */ "ISREDIT (last) = LINENUM .ZL" IF toline > last THEN toline = last IF toline < 1 THEN toline = 1 END ELSE DO /* label ? */ "ISREDIT (toline) = LINENUM (toline)" IF toline = 0 THEN DO zedsmsg = 'LABEL NOT FOUND' zedlmsg = 'THE LABEL YOU ENTERED ('ltoline') DOES', 'NOT EXIST.' "ISPEXEC SETMSG MSG(ISRZ001)" EXIT 12 END END /* swap from and to ? */ IF fromline > toline THEN DO tmp = fromline fromline = toline toline = tmp END END /* text to 14 from 32 byte */ text. = '' text.1 = 'Line is an original record' text.2 = 'Line was created by the Move line command' text.3 = 'Line was created by the Copy or Repeat line command' text.4 = 'Line was created by the MOVE primary or macro', 'command' text.5 = 'Line was created by the COPY primary or macro', 'command' text.6 = 'Line was created by the TE line command' text.7 = 'Line was created by the Insert line command' text.8 = 'Line was changed' text.9 = 'Data on the line was typed over' text.10 = 'Data was changed by the CHANGE primary command or', 'the Overlay line command' text.11 = 'Data was changed by the Column Shift line command', 'used the (, ((, ), or )) command' text.12 = 'Data was changed by the Data Shift line command', 'used the <, <<, >, or >> command' text.13 = 'Data was changed by the TE, TF, or TS line command' text.14 = 'The line was renumbered' /* more inits */ TRUE = 1 FALSE = 0 changes = FALSE j = 1 msg. = '' IF toline /= "" THEN msg.j = 'Following lines have been hanged', '(Range 'fromline+0'-'toline+0'):' nochang = 'No lines have been changed.' lineal = COPIES('-',72) IF toline /= "" THEN DO /* range */ /* collect information over the range ... */ DO i = fromline TO toline "ISREDIT (info) = LINE_STATUS (i)" IF SUBSTR(info,8,1) = 1 THEN DO msg.j = msg.j i changes = TRUE END IF LENGTH(msg.j) > = 68 THEN j = j + 1 END /* ... and display as ==MSG> lines */ "ISREDIT (first,dummy) = DISPLAY_LINES" "ISREDIT RES SPECIAL" "ISREDIT LINE_AFTER (first) = MSGLINE (lineal)" IF changes THEN DO DO i = j TO 1 BY -1 zeile = msg.i "ISREDIT LINE_AFTER (first) = MSGLINE (zeile)" END END ELSE DO "ISREDIT LINE_AFTER (first) = MSGLINE (nochang)" END "ISREDIT LINE_AFTER (first) = MSGLINE (lineal)" END ELSE DO /* just one line */ /* collect information over one line */ "ISREDIT (info) = LINE_STATUS (fromline)" /* collect longmessage ... */ zedlmsg = 'Line' fromline+0':' DO i = 1 TO 14 bit = SUBSTR(info,i,1) /* bit = 1 / 0 */ IF bit THEN DO zedlmsg = zedlmsg text.i"." END END /* ... and show it */ zedsmsg = '' "ISPEXEC SETMSG MSG(ISRZ000)" END EXIT