/* REXX CLISTLBL Show all labels in a CLIST and all references to those labels. */ address ISREDIT "MACRO (opts)" "X ALL" parse value "0 0 0" with sw. label. goto. golist lbllist sw.mon = Wordpos("MONITOR",opts) > 0 "F ' ' LAST" "(lastrow lastcol) = CURSOR" /* get last line # */ do zz = 1 to lastrow /* every line */ "(text) = LINE" zz /* acquire text */ if Pos(":",text) = 0 then iterate parse var text lbl ":" . lbl = Strip(lbl) if Left(lbl,1) = "&" then iterate if Length(lbl) > 15 then iterate if Words(lbl) = 1 then do parse value "1" Space(lbllist,1) lbl with label.lbl lbllist if sw.mon then say , zz":" lbllist end end /* zz */ "X ALL" locn = "FIRST" do forever "F WORD GOTO" locn if rc > 0 then leave /* didn't find it */ "(text) = LINE .zcsr" parse var text "GOTO" lbl . /* isolate label */ if \goto.lbl then do golist = golist lbl if sw.mon then say Space(text,1) end goto.lbl = "1" locn = "NEXT" end /* forever */ do zz = 1 to Words(lbllist) lbl = Word(lbllist,zz) "F ALL '"lbl":'" end /*do zz = 1 to Words(golist) lbl = Word(golist,zz) if Left(lbl,1) = "&" then iterate "F ALL WORD '"lbl"'" end */ "LINE_AFTER 0 = INFOLINE 'GOTO:" golist"'" "LINE_AFTER 0 = INFOLINE 'LBLs:" lbllist"'" exit /*@ CLISTLBL */