/* REXX MODNOTE Locate the last date entry in the 'Modification History' block. Insert after that last date entry a new entry, dated today with this author's initials and the text supplied as a parm. If no text was supplied, use 'alttext'. This enables MODNOTE to be rigged for repeated invocations for the same process. Syntax: modnote [ (( trace ?r ] */ parse source . . ex_nam . address ISREDIT "MACRO (opts)" if rc = 20 then do /* ISREDIT not available */ say ex_nam "is an EDIT macro without HELP" exit end parse var opts parms "((" opts modtext = parms upper opts /* shift up */ tv = '' author = "fxc" alttext = "changed tutorial to scrollable area;" parse var opts "TRACE" tv . parse value tv "N" with tv . rc = Trace('O') ; rc = Trace(tv) if modtext = "" then modtext = alttext "F FIRST '5c61'x 1 " /* first close-comment */ " (bottom) = LINENUM .zcsr " bottom = bottom+0 "F PREV P'########' 6 " /* last mod date */ if rc > 0 then, "F PREV '........' 6 " if rc > 0 then, "F PREV 'ccyymmdd' 6 " if rc > 0 then do /* Uh-oh... */ zedsmsg = "Couldn't find any." zedlmsg = "I looked for the prior 8-character date in 6-13", "before the first close-comment in 1. Received", "rc="rc" Is this block coded correctly?" address ISPEXEC "SETMSG MSG(ISRZ000)" exit end " (top) = LINENUM .zcsr " top = top+0 do idx = top to bottom-1 "XSTATUS" idx "= NX" "(txt) = LINE" idx if txt <> '' then tgt = idx else leave idx end modtext = ' 'Date("S") author Strip( modtext ) /* new mod entry */ "LINE_AFTER" tgt "= (modtext) " exit /*@ MODNOTE */