Skip to content

Instantly share code, notes, and snippets.

@lbdyck
Last active December 15, 2022 13:51
Show Gist options
  • Save lbdyck/3659966f346a76acb21359ba1105dac3 to your computer and use it in GitHub Desktop.
Save lbdyck/3659966f346a76acb21359ba1105dac3 to your computer and use it in GitHub Desktop.
ISPF Edit Macro to Add or Remove a label
/* ------------------------- REXX ------------------------------ *
| LABDEL: Sample REXX code to set a label and to remove a label |
| based upon the provided parm. |
| |
| Syntax: labdel option |
| |
| option value: null - add the label |
| anything else - remove the label |
| |
* ------------------------------------------------------------- *
| Author: Lionel B. Dyck |
* ------------------------------------------------------------- */
address isredit
'macro (opt)'
if opt = '' then do
/* Find string text */
"find 'string' first"
if rc > 0 then exit /* no string found */
'(line) = cursor' /* get line number */
'label' line '= .LAAA 0' /* set label .LAAA on the line */
end
else do
/* now remove the label */
'reset label .LAAA .LAAA'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment